mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 10:50:07 +00:00
Ghetto migrate solution, in case you re-run db_create, it won't add categories again
This commit is contained in:
parent
3bdff6246f
commit
b147cfeb81
|
@ -5,8 +5,9 @@ from nyaa import app, db, models
|
||||||
|
|
||||||
db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
# Insert categories
|
# Insert categories and insert if it doesn't eixst
|
||||||
|
existing_cats = models.MainCategory.query.all()
|
||||||
|
if not existing_cats:
|
||||||
if app.config['SITE_FLAVOR'] == 'nyaa':
|
if app.config['SITE_FLAVOR'] == 'nyaa':
|
||||||
CATEGORIES = [
|
CATEGORIES = [
|
||||||
('Anime', ['Anime Music Video', 'English-translated', 'Non-English-translated', 'Raw']),
|
('Anime', ['Anime Music Video', 'English-translated', 'Non-English-translated', 'Raw']),
|
||||||
|
|
Loading…
Reference in a new issue