generated from TheMrPhantom/react-vorlage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:TheMrPhantom/DrinklistV4
- Loading branch information
Showing
14 changed files
with
4,396 additions
and
3,379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from flask_sqlalchemy import SQLAlchemy | ||
from database.Models import * | ||
from sqlalchemy.orm import session | ||
from sqlalchemy import text | ||
import util | ||
|
||
|
||
def migrate(db: session): | ||
current_db_version: KeyValue = db.query(KeyValue).filter_by( | ||
key="version").first() | ||
print("Current database version:", current_db_version.value) | ||
|
||
migrations = [ | ||
# Add lists for migrations | ||
# E.g ALTER TABLE drink ADD column price6 float DEFAULT 50 | ||
#["ALTER TABLE drink ADD column price6 float DEFAULT 50"] | ||
] | ||
|
||
if util.CURRENT_VERSION != len(migrations): | ||
print("Error: No migration available") | ||
exit() | ||
|
||
for migration in migrations[int(current_db_version.value):]: | ||
print("Migrating from", current_db_version.value, | ||
"to", int(current_db_version.value)+1) | ||
for statement in migration: | ||
db.execute(text(statement)) | ||
current_db_version.value = int(current_db_version.value)+1 | ||
db.commit() | ||
|
||
print("Migrations complete") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:18-alpine | ||
FROM node:20-alpine | ||
|
||
# set working directory | ||
WORKDIR /app | ||
|
@@ -9,7 +9,6 @@ ENV PATH /app/node_modules/.bin:$PATH | |
# install app dependencies | ||
COPY package.json ./ | ||
COPY package-lock.json ./ | ||
RUN npm cache verify | ||
RUN npm install | ||
RUN npm install [email protected] -g | ||
RUN npm install -g serve | ||
|
Oops, something went wrong.