diff --git a/.DS_Store b/.DS_Store index 1edbe20..1167484 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 325ce06..c24e75f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,7 @@ __pycache__ # testcode .pytest_cache .coverage -cov_html \ No newline at end of file +cov_html + +# database +migrations \ No newline at end of file diff --git a/Makefile b/Makefile index fdefc8e..1574808 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,12 @@ GREEN=\033[1;32;40m RED=\033[1;31;40m NC=\033[0m # No Color +database: + @bash -c "echo -e \"${GREEN}[db orm 시작]${NC}\"" + python manage.py db init + python manage.py db migrate + python manage.py db upgrade + test: @bash -c "echo -e \"${GREEN}[pytest 시작]${NC}\"" pipenv run pytest app/tests --cov-report=html:cov_html --cov-report=term --cov=app \ No newline at end of file diff --git a/app/users/views.py b/app/users/views.py index d460553..132bfbf 100644 --- a/app/users/views.py +++ b/app/users/views.py @@ -14,7 +14,6 @@ API = Namespace('Users', description="User's RESTPlus - API") USERS_SCHEMA = UsersSchema() - @API.route('s') class UsersAuth(Resource): parser = reqparse.RequestParser() @@ -40,7 +39,6 @@ def post(self): user = Users(args_['user_id'], hash_pw, args_['user_email']) return user.add(user, USERS_SCHEMA) - @API.route('/auth') class UserAuth(Resource): parser = reqparse.RequestParser() diff --git a/migrations/versions/bb32b366dab2_.py b/migrations/versions/bb32b366dab2_.py deleted file mode 100644 index 889e016..0000000 --- a/migrations/versions/bb32b366dab2_.py +++ /dev/null @@ -1,37 +0,0 @@ -"""empty message - -Revision ID: bb32b366dab2 -Revises: d8019933f2c3 -Create Date: 2019-07-23 15:07:27.216578 - -""" -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision = 'bb32b366dab2' -down_revision = 'd8019933f2c3' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.create_table('posts', - sa.Column('id', sa.Integer(), nullable=False), - sa.Column('author_id', sa.String(length=255), nullable=True), - sa.Column('title', sa.String(length=512), nullable=False), - sa.Column('body', sa.String(length=1024), nullable=False), - sa.Column('created', sa.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False), - sa.ForeignKeyConstraint(['author_id'], ['users.user_id'], ), - sa.PrimaryKeyConstraint('id'), - mysql_collate='utf8_general_ci' - ) - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.drop_table('posts') - # ### end Alembic commands ### diff --git a/migrations/versions/d8019933f2c3_.py b/migrations/versions/d8019933f2c3_.py deleted file mode 100644 index 49beca2..0000000 --- a/migrations/versions/d8019933f2c3_.py +++ /dev/null @@ -1,37 +0,0 @@ -"""empty message - -Revision ID: d8019933f2c3 -Revises: -Create Date: 2019-07-23 12:06:26.634913 - -""" -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision = 'd8019933f2c3' -down_revision = None -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.create_table('users', - sa.Column('id', sa.Integer(), nullable=False), - sa.Column('user_id', sa.String(length=255), nullable=False), - sa.Column('user_password', sa.String(length=255), nullable=False), - sa.Column('user_email', sa.String(length=255), nullable=False), - sa.Column('created', sa.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False), - sa.PrimaryKeyConstraint('id'), - sa.UniqueConstraint('user_id'), - mysql_collate='utf8_general_ci' - ) - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.drop_table('users') - # ### end Alembic commands ###