Skip to content

Commit cad45da

Browse files
committed
migration
1 parent b16a41b commit cad45da

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""drop user_to_projects
2+
3+
Revision ID: e33493b49140
4+
Revises: 0d52976dc616
5+
Create Date: 2025-05-01 20:06:49.642271+00:00
6+
7+
"""
8+
9+
import sqlalchemy as sa
10+
from alembic import op
11+
12+
# revision identifiers, used by Alembic.
13+
revision = "e33493b49140"
14+
down_revision = "0d52976dc616"
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.drop_table("user_to_projects")
22+
# ### end Alembic commands ###
23+
24+
25+
def downgrade():
26+
# ### commands auto generated by Alembic - please adjust! ###
27+
op.create_table(
28+
"user_to_projects",
29+
sa.Column("id", sa.BIGINT(), autoincrement=True, nullable=False),
30+
sa.Column("user_id", sa.BIGINT(), autoincrement=False, nullable=False),
31+
sa.Column("project_id", sa.BIGINT(), autoincrement=False, nullable=False),
32+
sa.ForeignKeyConstraint(
33+
["project_id"],
34+
["projects.id"],
35+
name="fk_user_to_projects_id_projects",
36+
onupdate="CASCADE",
37+
ondelete="CASCADE",
38+
),
39+
sa.ForeignKeyConstraint(
40+
["user_id"],
41+
["users.id"],
42+
name="fk_user_to_projects_id_users",
43+
onupdate="CASCADE",
44+
ondelete="CASCADE",
45+
),
46+
sa.PrimaryKeyConstraint("id", name="user_to_projects_pkey"),
47+
)
48+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)