Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : bkabrda-workspace
commit 36c17162b573ba930e172251ea80081972cc6bc9 Author: Bohuslav Kabrda bkabrda@redhat.com Date: Mon Nov 26 08:04:57 2012 +0100
Add some more data that we may use in future, regenerate the alembic initial DB setup (noone is using this, so no migrations are needed yet)
...b_setup.py => 2d24d28534b6_initial_db_setup.py} | 9 ++++++--- wsgi/coprs/models.py | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/wsgi/alembic/versions/2999fd4de2a7_initial_db_setup.py b/wsgi/alembic/versions/2d24d28534b6_initial_db_setup.py similarity index 90% rename from wsgi/alembic/versions/2999fd4de2a7_initial_db_setup.py rename to wsgi/alembic/versions/2d24d28534b6_initial_db_setup.py index 8c0f24f..8ca01d7 100644 --- a/wsgi/alembic/versions/2999fd4de2a7_initial_db_setup.py +++ b/wsgi/alembic/versions/2d24d28534b6_initial_db_setup.py @@ -1,13 +1,13 @@ """Initial DB setup
-Revision ID: 2999fd4de2a7 +Revision ID: 2d24d28534b6 Revises: None -Create Date: 2012-11-19 13:09:17.167104 +Create Date: 2012-11-26 08:02:34.063991
"""
# revision identifiers, used by Alembic. -revision = '2999fd4de2a7' +revision = '2d24d28534b6' down_revision = None
from alembic import op @@ -19,7 +19,9 @@ def upgrade(): op.create_table('user', sa.Column('id', sa.Integer(), nullable=False), sa.Column('openid_name', sa.String(length=100), nullable=False), + sa.Column('mail', sa.String(length=150), nullable=False), sa.Column('proven', sa.Boolean(), nullable=True), + sa.Column('admin', sa.Boolean(), nullable=True), sa.PrimaryKeyConstraint('id') ) op.create_table('copr', @@ -27,6 +29,7 @@ def upgrade(): sa.Column('name', sa.String(length=100), nullable=False), sa.Column('chroots', sa.Text(), nullable=False), sa.Column('repos', sa.Text(), nullable=True), + sa.Column('created_on', sa.Integer(), nullable=True), sa.Column('build_count', sa.Integer(), nullable=True), sa.Column('owner_id', sa.Integer(), nullable=True), sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ), diff --git a/wsgi/coprs/models.py b/wsgi/coprs/models.py index b36315e..3e4f3ae 100644 --- a/wsgi/coprs/models.py +++ b/wsgi/coprs/models.py @@ -50,7 +50,9 @@ class Serializer(object): class User(db.Model, Serializer): id = db.Column(db.Integer, primary_key = True) openid_name = db.Column(db.String(100), nullable = False) + mail = db.Column(db.String(150), nullable = False) proven = db.Column(db.Boolean, default = False) + admin = db.Column(db.Boolean, default = False)
@property def name(self): @@ -86,6 +88,7 @@ class Copr(db.Model, Serializer): name = db.Column(db.String(100), nullable = False) chroots = db.Column(db.Text, nullable = False) repos = db.Column(db.Text) + created_on = db.Column(db.Integer) # duplicate information, but speeds up a lot and makes queries simpler build_count = db.Column(db.Integer, default = 0)
copr-devel@lists.fedorahosted.org