22 lines
773 B
Python
22 lines
773 B
Python
from tortoise import migrations
|
|
from tortoise.migrations import operations as ops
|
|
from uuid import uuid4
|
|
from tortoise import fields
|
|
|
|
class Migration(migrations.Migration):
|
|
initial = True
|
|
|
|
operations = [
|
|
ops.CreateModel(
|
|
name='Comment',
|
|
fields=[
|
|
('id', fields.UUIDField(primary_key=True, default=uuid4, unique=True, db_index=True)),
|
|
('created_at', fields.DatetimeField(auto_now=False, auto_now_add=True)),
|
|
('updated_at', fields.DatetimeField(auto_now=True, auto_now_add=False)),
|
|
('content', fields.TextField(unique=False)),
|
|
],
|
|
options={'table': 'comment', 'app': 'models', 'pk_attr': 'id'},
|
|
bases=['AbstractModel'],
|
|
),
|
|
]
|