mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 21:49:37 -04:00
Tests added for dao.
This commit is contained in:
43
migrations/versions/80_remove_services.py
Normal file
43
migrations/versions/80_remove_services.py
Normal file
@@ -0,0 +1,43 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 80_remove_services
|
||||
Revises: 70_unique_email
|
||||
Create Date: 2016-01-14 17:48:42.426979
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '80_remove_services'
|
||||
down_revision = '70_unique_email'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('user_to_service')
|
||||
op.drop_table('services')
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('services',
|
||||
sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('services_id_seq'::regclass)"), nullable=False),
|
||||
sa.Column('name', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
|
||||
sa.Column('created_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
|
||||
sa.Column('active', sa.BOOLEAN(), autoincrement=False, nullable=False),
|
||||
sa.Column('limit', sa.BIGINT(), autoincrement=False, nullable=False),
|
||||
sa.Column('restricted', sa.BOOLEAN(), autoincrement=False, nullable=False),
|
||||
sa.PrimaryKeyConstraint('id', name='services_pkey'),
|
||||
sa.UniqueConstraint('name', name='services_name_key'),
|
||||
postgresql_ignore_search_path=False
|
||||
)
|
||||
op.create_table('user_to_service',
|
||||
sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True),
|
||||
sa.Column('service_id', sa.INTEGER(), autoincrement=False, nullable=True),
|
||||
sa.ForeignKeyConstraint(['service_id'], ['services.id'], name='user_to_service_service_id_fkey'),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], name='user_to_service_user_id_fkey')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
Reference in New Issue
Block a user