mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Deletion on User_Servers table
This commit is contained in:
parent
88042998d9
commit
0b29bdf855
@ -118,18 +118,6 @@ class Servers(Model):
|
||||
class Meta:
|
||||
table_name = "servers"
|
||||
database = database
|
||||
|
||||
|
||||
class User_Servers(Model):
|
||||
user_id = ForeignKeyField(Users, backref='user_server')
|
||||
server_id = ForeignKeyField(Servers, backref='user_server')
|
||||
permissions = CharField(default="00000000")
|
||||
|
||||
class Meta:
|
||||
table_name = 'user_servers'
|
||||
primary_key = CompositeKey('user_id', 'server_id')
|
||||
database = database
|
||||
|
||||
|
||||
class Role_Servers(Model):
|
||||
role_id = ForeignKeyField(Roles, backref='role_server')
|
||||
|
28
app/migrations/20210822101530_delete_User_Servers.py
Normal file
28
app/migrations/20210822101530_delete_User_Servers.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Generated by database migrator
|
||||
from peewee import *
|
||||
from app.classes.shared.models import Users, Servers
|
||||
|
||||
|
||||
def migrate(migrator, database, **kwargs):
|
||||
migrator.drop_table('user_servers') # Can be model class OR table name
|
||||
"""
|
||||
Write your migrations here.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
def rollback(migrator, database, **kwargs):
|
||||
db = database
|
||||
class User_Servers(Model):
|
||||
user_id = ForeignKeyField(Users, backref='user_server')
|
||||
server_id = ForeignKeyField(Servers, backref='user_server')
|
||||
permissions = CharField(default="00000000")
|
||||
|
||||
class Meta:
|
||||
table_name = 'user_servers'
|
||||
primary_key = CompositeKey('user_id', 'server_id')
|
||||
database = db
|
||||
migrator.create_table(User_Servers)
|
||||
"""
|
||||
Write your rollback migrations here.
|
||||
"""
|
Loading…
Reference in New Issue
Block a user