Remove flask-migrate.

This commit is contained in:
yohan 2024-06-21 16:53:35 +02:00
parent 71a009e03c
commit 54b6e78a90
4 changed files with 2 additions and 8 deletions

View File

@ -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"]

2
api.py
View File

@ -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)

View File

@ -1,3 +1,3 @@
#!/bin/bash
/root/migrate_db.sh && exec flask run
exec flask run

View File

@ -1,3 +0,0 @@
#!/bin/bash
flask db init; flask db migrate -m "Database migration." && flask db upgrade