mirror of
https://github.com/Eugeny/tabby-web.git
synced 2026-08-18 15:26:04 +01:00
wip
This commit is contained in:
@@ -32,8 +32,8 @@ class Migration(migrations.Migration):
|
||||
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
|
||||
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
|
||||
('active_version', models.CharField(max_length=32, null=True)),
|
||||
('custom_connection_gateway', models.CharField(max_length=255, null=True)),
|
||||
('custom_connection_gateway_token', models.CharField(max_length=255, null=True)),
|
||||
('custom_connection_gateway', models.CharField(max_length=255, null=True, blank=True)),
|
||||
('custom_connection_gateway_token', models.CharField(max_length=255, null=True, blank=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('modified_at', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
|
||||
29
tabby/app/migrations/0004_sync_token.py
Normal file
29
tabby/app/migrations/0004_sync_token.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import secrets
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def run_forward(apps, schema_editor):
|
||||
for user in apps.get_model('app', 'User').objects.all():
|
||||
user.config_sync_token = secrets.token_hex(64)
|
||||
user.save()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('app', '0003_auto_20210711_1855'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='user',
|
||||
name='config_sync_token',
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.RunPython(run_forward, lambda _, __: None),
|
||||
migrations.AlterField(
|
||||
model_name='user',
|
||||
name='config_sync_token',
|
||||
field=models.CharField(max_length=255),
|
||||
),
|
||||
]
|
||||
18
tabby/app/migrations/0005_user_force_pro.py
Normal file
18
tabby/app/migrations/0005_user_force_pro.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.3 on 2021-07-24 10:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('app', '0004_sync_token'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='user',
|
||||
name='force_pro',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
||||
28
tabby/app/migrations/0006_config_name.py
Normal file
28
tabby/app/migrations/0006_config_name.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def run_forward(apps, schema_editor):
|
||||
for config in apps.get_model('app', 'Config').objects.all():
|
||||
config.name = f'Unnamed config ({config.created_at.date()})'
|
||||
config.save()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('app', '0005_user_force_pro'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='config',
|
||||
name='name',
|
||||
field=models.CharField(max_length=255, null=True),
|
||||
),
|
||||
migrations.RunPython(run_forward, lambda _, __: None),
|
||||
migrations.AlterField(
|
||||
model_name='config',
|
||||
name='name',
|
||||
field=models.CharField(max_length=255),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user