imports-format+id-fix+remigrate
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Column, String, ForeignKey, DateTime
|
||||
from sqlalchemy import Column, DateTime, ForeignKey, String
|
||||
|
||||
from base.orm import Base
|
||||
|
||||
@@ -16,8 +16,7 @@ class ShoutCollection(Base):
|
||||
class Collection(Base):
|
||||
__tablename__ = "collection"
|
||||
|
||||
id = None # type: ignore
|
||||
slug = Column(String, primary_key=True)
|
||||
slug = Column(String, unique=True)
|
||||
title = Column(String, nullable=False, comment="Title")
|
||||
body = Column(String, nullable=True, comment="Body")
|
||||
pic = Column(String, nullable=True, comment="Picture")
|
||||
|
@@ -1,6 +1,6 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, Boolean
|
||||
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, String
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from base.orm import Base
|
||||
@@ -50,8 +50,7 @@ class ShoutAllowed(Base):
|
||||
class Shout(Base):
|
||||
__tablename__ = "shout"
|
||||
|
||||
id = None # type: ignore
|
||||
slug = Column(String, primary_key=True)
|
||||
slug = Column(String, unique=True)
|
||||
community = Column(Integer, ForeignKey("community.id"), nullable=False, comment="Community")
|
||||
lang = Column(String, nullable=False, default='ru', comment="Language")
|
||||
body = Column(String, nullable=False, comment="Body")
|
||||
|
@@ -1,6 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Column, Boolean, String, ForeignKey, DateTime, JSON as JSONType
|
||||
from sqlalchemy import JSON as JSONType
|
||||
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, String
|
||||
|
||||
from base.orm import Base
|
||||
|
||||
@@ -20,8 +21,7 @@ class TopicFollower(Base):
|
||||
class Topic(Base):
|
||||
__tablename__ = "topic"
|
||||
|
||||
id = None # type: ignore
|
||||
slug = Column(String, primary_key=True)
|
||||
slug = Column(String, unique=True)
|
||||
title = Column(String, nullable=False, comment="Title")
|
||||
body = Column(String, nullable=True, comment="Body")
|
||||
pic = Column(String, nullable=True, comment="Picture")
|
||||
|
11
orm/user.py
11
orm/user.py
@@ -1,14 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import (
|
||||
Column,
|
||||
Integer,
|
||||
String,
|
||||
ForeignKey,
|
||||
Boolean,
|
||||
DateTime,
|
||||
JSON as JSONType,
|
||||
)
|
||||
from sqlalchemy import JSON as JSONType
|
||||
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, String
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from base.orm import Base, local_session
|
||||
|
Reference in New Issue
Block a user