diff options
Diffstat (limited to 'gitsrht/types/repository.py')
-rw-r--r-- | gitsrht/types/repository.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/gitsrht/types/repository.py b/gitsrht/types/repository.py deleted file mode 100644 index b5779c8..0000000 --- a/gitsrht/types/repository.py +++ /dev/null @@ -1,26 +0,0 @@ -import sqlalchemy as sa -import sqlalchemy_utils as sau -from srht.database import Base -from enum import Enum - -class RepoVisibility(Enum): - autocreated = 'autocreated' - """Used for repositories that were created automatically on push""" - public = 'public' - private = 'private' - unlisted = 'unlisted' - -class Repository(Base): - __tablename__ = 'repository' - id = sa.Column(sa.Integer, primary_key=True) - created = sa.Column(sa.DateTime, nullable=False) - updated = sa.Column(sa.DateTime, nullable=False) - name = sa.Column(sa.Unicode(256), nullable=False) - description = sa.Column(sa.Unicode(1024)) - owner_id = sa.Column(sa.Integer, sa.ForeignKey('user.id'), nullable=False) - owner = sa.orm.relationship('User', backref=sa.orm.backref('repos')) - path = sa.Column(sa.Unicode(1024)) - visibility = sa.Column( - sau.ChoiceType(RepoVisibility, impl=sa.String()), - nullable=False, - default=RepoVisibility.public) |