From 34613bba1e1715cf172f4ba6f4cc73d77c90593f Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Thu, 27 Mar 2025 05:31:31 -0500 Subject: [PATCH] Add migration for Name --- .../20250327_053117_e5f13a47_create_name.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 alembic/versions/20250327_053117_e5f13a47_create_name.py diff --git a/alembic/versions/20250327_053117_e5f13a47_create_name.py b/alembic/versions/20250327_053117_e5f13a47_create_name.py new file mode 100644 index 0000000..1f0ddc2 --- /dev/null +++ b/alembic/versions/20250327_053117_e5f13a47_create_name.py @@ -0,0 +1,30 @@ +"""create names table + +Revision ID: 1234567890ab +Revises: +Create Date: 2023-05-19 10:00:00.000000 + +""" +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects.postgresql import UUID + +# revision identifiers, used by Alembic. +revision = '1234567890ab' +down_revision = None +branch_labels = None +depends_on = None + + +def upgrade(): + op.create_table( + 'names', + sa.Column('id', UUID(as_uuid=True), primary_key=True, server_default=sa.text("uuid_generate_v4()")), + sa.Column('name', sa.String, nullable=False, unique=True), + sa.Column('created_at', sa.DateTime, server_default=sa.func.now()), + sa.Column('updated_at', sa.DateTime, server_default=sa.func.now(), onupdate=sa.func.now()) + ) + + +def downgrade(): + op.drop_table('names') \ No newline at end of file