Migration
This commit is contained in:
parent
8a2b9247e1
commit
c43efa4b10
2 changed files with 29 additions and 0 deletions
|
@ -0,0 +1,28 @@
|
||||||
|
"""Add user associations
|
||||||
|
|
||||||
|
Revision ID: 5c8378aa4dff
|
||||||
|
Revises: 55013fe95bea
|
||||||
|
Create Date: 2022-05-20 21:32:47.786340
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '5c8378aa4dff'
|
||||||
|
down_revision = '55013fe95bea'
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('order', sa.Column('association', sa.String(length=120), nullable=True))
|
||||||
|
op.add_column('user', sa.Column('associations', sa.String(length=120), nullable=True))
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_column('user', 'associations')
|
||||||
|
op.drop_column('order', 'association')
|
||||||
|
# ### end Alembic commands ###
|
|
@ -27,6 +27,7 @@ class Order(db.Model):
|
||||||
stoptime = db.Column(db.DateTime)
|
stoptime = db.Column(db.DateTime)
|
||||||
public = db.Column(db.Boolean, default=True)
|
public = db.Column(db.Boolean, default=True)
|
||||||
slug = db.Column(db.String(7), default=generate_slug, unique=True)
|
slug = db.Column(db.String(7), default=generate_slug, unique=True)
|
||||||
|
association = db.Column(db.String(120))
|
||||||
|
|
||||||
items = db.relationship("OrderItem", backref="order", lazy="dynamic")
|
items = db.relationship("OrderItem", backref="order", lazy="dynamic")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue