-
Notifications
You must be signed in to change notification settings - Fork 856
/
Copy path0001_initial.py
100 lines (94 loc) · 5.5 KB
/
0001_initial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Generated by Django 3.2.18 on 2023-04-27 14:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='DBConfig',
fields=[
('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=1024, verbose_name='连接名')),
('db_type', models.CharField(choices=[('MySQL', 'MySQL'), ('SQLServer', 'SQLServer'), ('MongoDB', 'MongoDB')], max_length=50, verbose_name='数据库类型')),
('host', models.GenericIPAddressField(verbose_name='主机')),
('port', models.IntegerField(verbose_name='端口号')),
('username', models.CharField(max_length=1024, verbose_name='用户名')),
('password', models.CharField(max_length=1024, verbose_name='密码')),
],
options={
'verbose_name': '数据库配置',
'verbose_name_plural': '数据库管理',
},
),
migrations.CreateModel(
name='ScriptInfo',
fields=[
('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=128, verbose_name='名称')),
('type', models.CharField(choices=[(1, 'Python脚本')], default=1, max_length=50, verbose_name='脚本类型')),
('script_path', models.CharField(max_length=128, verbose_name='脚本路径')),
('file_name', models.CharField(default='0', max_length=128, verbose_name='文件名称')),
('size', models.CharField(default='0M', max_length=128, verbose_name='文件大小')),
('desc', models.TextField(blank=True, null=True, verbose_name='脚本说明')),
('user', models.ForeignKey(max_length=1024, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='脚本共享人')),
],
options={
'verbose_name': '脚本',
'verbose_name_plural': '脚本管理',
},
),
migrations.CreateModel(
name='SQLHistory',
fields=[
('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
('id', models.AutoField(primary_key=True, serialize=False)),
('db', models.CharField(default='test', max_length=1024, verbose_name='数据库')),
('table', models.CharField(max_length=1024, verbose_name='表')),
('SQL_type', models.CharField(choices=[('POST', '改'), ('GET', '查'), ('PUT', '增'), ('DELETE', '删')], default='PUT', max_length=10, null=True, verbose_name='操作类型')),
('history', models.TextField(verbose_name='操作内容')),
('server', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='tools.dbconfig', verbose_name='服务器')),
],
options={
'verbose_name': '数据库操作记录',
'verbose_name_plural': '数据库操作记录',
},
),
migrations.CreateModel(
name='ScriptRunHistory',
fields=[
('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
('id', models.AutoField(primary_key=True, serialize=False)),
('script', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='history_script_name', to='tools.scriptinfo', verbose_name='脚本名称')),
('user', models.ForeignKey(max_length=1024, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='history_user_name', to=settings.AUTH_USER_MODEL, verbose_name='脚本执行人')),
],
options={
'verbose_name': '脚本运行记录',
'verbose_name_plural': '脚本运行记录',
},
),
migrations.CreateModel(
name='ScriptLibrary',
fields=[
('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=128, verbose_name='依赖库名称')),
('version', models.CharField(max_length=128, verbose_name='版本')),
],
options={
'verbose_name': '依赖库',
'verbose_name_plural': '依赖库管理',
'unique_together': {('name',)},
},
),
]