<reponame>RagtagOpen/carpools
"""initial

Revision ID: 6833d8b7e849
Revises: 
Create Date: 2017-04-09 10:48:39.834030

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6833d8b7e<PASSWORD>'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('people',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
    sa.Column('social_id', sa.String(length=64), nullable=False),
    sa.Column('email', sa.String(length=120), nullable=True),
    sa.Column('name', sa.String(length=80), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('social_id')
    )
    op.create_table('carpools',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
    sa.Column('from_place', sa.String(length=120), nullable=True),
    sa.Column('to_place', sa.String(length=120), nullable=True),
    sa.Column('leave_time', sa.DateTime(timezone=True), nullable=True),
    sa.Column('return_time', sa.DateTime(timezone=True), nullable=True),
    sa.Column('max_riders', sa.Integer(), nullable=True),
    sa.Column('driver_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['driver_id'], ['people.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('riders',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('person_id', sa.Integer(), nullable=True),
    sa.Column('carpool_id', sa.Integer(), nullable=True),
    sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
    sa.Column('status', sa.String(length=120), nullable=True),
    sa.ForeignKeyConstraint(['carpool_id'], ['carpools.id'], ),
    sa.ForeignKeyConstraint(['person_id'], ['people.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('riders')
    op.drop_table('carpools')
    op.drop_table('people')
    # ### end Alembic commands ###

"""initial

Revision ID: 6833d8b7e849
Revises: 
Create Date: 2017-04-09 10:48:39.834030

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6833d8b7e<PASSWORD>'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('people',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
    sa.Column('social_id', sa.String(length=64), nullable=False),
    sa.Column('email', sa.String(length=120), nullable=True),
    sa.Column('name', sa.String(length=80), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('social_id')
    )
    op.create_table('carpools',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
    sa.Column('from_place', sa.String(length=120), nullable=True),
    sa.Column('to_place', sa.String(length=120), nullable=True),
    sa.Column('leave_time', sa.DateTime(timezone=True), nullable=True),
    sa.Column('return_time', sa.DateTime(timezone=True), nullable=True),
    sa.Column('max_riders', sa.Integer(), nullable=True),
    sa.Column('driver_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['driver_id'], ['people.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('riders',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('person_id', sa.Integer(), nullable=True),
    sa.Column('carpool_id', sa.Integer(), nullable=True),
    sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
    sa.Column('status', sa.String(length=120), nullable=True),
    sa.ForeignKeyConstraint(['carpool_id'], ['carpools.id'], ),
    sa.ForeignKeyConstraint(['person_id'], ['people.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('riders')
    op.drop_table('carpools')
    op.drop_table('people')
    # ### end Alembic commands ###
initial  Revision ID: 6833d8b7e849 Revises:  Create Date: 2017-04-09 10:48:39.834030 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###