From 54b6e78a90b5fd49ba4e7f4f23aec1b74cb1c416 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Fri, 21 Jun 2024 16:53:35 +0200 Subject: [PATCH] Remove flask-migrate. --- Dockerfile | 3 +-- api.py | 2 -- entrypoint.sh | 2 +- migrate_db.sh | 3 --- 4 files changed, 2 insertions(+), 8 deletions(-) delete mode 100755 migrate_db.sh diff --git a/Dockerfile b/Dockerfile index d7a01d6..ad4a961 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,8 @@ MAINTAINER yohan <783b8c87@scimetis.net> ENV DEBIAN_FRONTEND noninteractive ENV TZ Europe/Paris RUN apt-get update && apt-get -y install python-pip python-mysqldb python-yaml -RUN pip install flask-restx flask-sqlalchemy flask-migrate +RUN pip install flask-restx flask-sqlalchemy WORKDIR /root COPY api.py /root/ -COPY migrate_db.sh /root/ COPY entrypoint.sh /root/ ENTRYPOINT ["/root/entrypoint.sh"] diff --git a/api.py b/api.py index 525d2b8..2b1f020 100644 --- a/api.py +++ b/api.py @@ -2,7 +2,6 @@ from flask import Flask, request from flask_restx import Api, Resource, fields from functools import wraps from flask_sqlalchemy import SQLAlchemy -from flask_migrate import Migrate import json import logging import yaml @@ -262,5 +261,4 @@ api.add_namespace(ns_stock) api.add_namespace(ns_float_metric) api.add_namespace(ns_integer_metric) db.create_all() -migrate = Migrate(app, db, compare_type=True) diff --git a/entrypoint.sh b/entrypoint.sh index a9b3eb5..dfb5d2b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,3 @@ #!/bin/bash -/root/migrate_db.sh && exec flask run +exec flask run diff --git a/migrate_db.sh b/migrate_db.sh deleted file mode 100755 index 89d5945..0000000 --- a/migrate_db.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -flask db init; flask db migrate -m "Database migration." && flask db upgrade