mirror of
https://github.com/sb745/NyaaV3.git
synced 2025-03-12 22:06:55 +02: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
1 changed files with 26 additions and 25 deletions
|
@ -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…
Add table
Reference in a new issue