119 lines
5.9 KiB
Python
Executable File
119 lines
5.9 KiB
Python
Executable File
# Generated by Django 4.1.3 on 2023-04-05 07:19
|
|
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import django.utils.timezone
|
|
import fwd_api.models.fields.EncryptedCharField
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='OcrTemplate',
|
|
fields=[
|
|
('id', models.AutoField(primary_key=True, serialize=False)),
|
|
('name', models.CharField(max_length=300)),
|
|
('status', models.IntegerField()),
|
|
('file_path', fwd_api.models.fields.EncryptedCharField.EncryptedCharField(max_length=500, null=True)),
|
|
('file_name', fwd_api.models.fields.EncryptedCharField.EncryptedCharField(max_length=500, null=True)),
|
|
('created_at', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='PricingPlan',
|
|
fields=[
|
|
('id', models.AutoField(primary_key=True, serialize=False)),
|
|
('code', models.CharField(max_length=300)),
|
|
('token_limitations', models.IntegerField(default=0)),
|
|
('duration', models.IntegerField(default=0)),
|
|
('created_at', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Subscription',
|
|
fields=[
|
|
('id', models.AutoField(primary_key=True, serialize=False)),
|
|
('current_token', models.IntegerField(default=0)),
|
|
('limit_token', models.IntegerField(default=0)),
|
|
('status', models.IntegerField(default=0)),
|
|
('start_at', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('expired_at', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('created_at', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('pricing_plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='fwd_api.pricingplan')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='SubscriptionRequest',
|
|
fields=[
|
|
('id', models.AutoField(primary_key=True, serialize=False)),
|
|
('pages', models.IntegerField()),
|
|
('doc_type', models.CharField(max_length=100)),
|
|
('request_id', models.CharField(max_length=200)),
|
|
('process_type', models.CharField(max_length=200)),
|
|
('provider_code', models.CharField(default='Guest', max_length=200)),
|
|
('predict_result', models.JSONField(null=True)),
|
|
('status', models.IntegerField()),
|
|
('created_at', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('subscription', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='fwd_api.subscription')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='UserProfile',
|
|
fields=[
|
|
('id', models.AutoField(primary_key=True, serialize=False)),
|
|
('full_name', models.CharField(max_length=100)),
|
|
('sync_id', models.CharField(max_length=100)),
|
|
('provider_id', models.CharField(default='Ctel', max_length=100)),
|
|
('current_total_pages', models.IntegerField(default=0)),
|
|
('limit_total_pages', models.IntegerField(default=0)),
|
|
('status', models.IntegerField(default=0)),
|
|
('created_at', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='SubscriptionRequestFile',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('file_name', models.CharField(default=None, max_length=300)),
|
|
('file_path', fwd_api.models.fields.EncryptedCharField.EncryptedCharField(default=None, max_length=500)),
|
|
('file_category', models.CharField(default='Origin', max_length=200)),
|
|
('created_at', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('request', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='files', to='fwd_api.subscriptionrequest')),
|
|
],
|
|
),
|
|
migrations.AddField(
|
|
model_name='subscription',
|
|
name='user',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='fwd_api.userprofile'),
|
|
),
|
|
migrations.CreateModel(
|
|
name='OcrTemplateBox',
|
|
fields=[
|
|
('id', models.AutoField(primary_key=True, serialize=False)),
|
|
('name', models.CharField(max_length=300, null=True)),
|
|
('type', models.CharField(max_length=100)),
|
|
('coordinates', models.CharField(max_length=200)),
|
|
('created_at', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='fwd_api.ocrtemplate')),
|
|
],
|
|
),
|
|
migrations.AddField(
|
|
model_name='ocrtemplate',
|
|
name='subscription',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='fwd_api.subscription'),
|
|
),
|
|
]
|