parent
518fc3101e
commit
42bab0739b
@ -0,0 +1,27 @@ |
||||
# Generated by Django 3.2.3 on 2022-02-14 20:42 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
dependencies = [ |
||||
('api', '0034_auto_20220208_0941'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AddField( |
||||
model_name='systemconfig', |
||||
name='enable', |
||||
field=models.BooleanField(default=True, verbose_name='是否启用该配置项'), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='systemconfig', |
||||
name='key', |
||||
field=models.CharField(max_length=128, unique=True, verbose_name='配置名称'), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='systemconfig', |
||||
name='value', |
||||
field=models.TextField(max_length=10240, verbose_name='配置值'), |
||||
), |
||||
] |
@ -1,5 +0,0 @@ |
||||
#!/usr/bin/env python |
||||
# -*- coding:utf-8 -*- |
||||
# project: 5月 |
||||
# author: NinEveN |
||||
# date: 2021/5/27 |
@ -0,0 +1,16 @@ |
||||
#!/usr/bin/env python |
||||
# -*- coding:utf-8 -*- |
||||
# author: NinEveN |
||||
# date: 2022/2/14 |
||||
|
||||
class DBRouter(object): |
||||
def db_for_read(self, model, **hints): |
||||
# |
||||
# if model._meta.model_name == 'Price': |
||||
# return 'db1' |
||||
# else: |
||||
# return 'default' |
||||
return 'slave' |
||||
|
||||
def db_for_write(self, model, **hints): |
||||
return 'default' |
Loading…
Reference in new issue