diff --git a/panoramix/migrations/versions/2591d77e9831_user_id.py b/panoramix/migrations/versions/2591d77e9831_user_id.py new file mode 100644 index 0000000000000..5039078e901eb --- /dev/null +++ b/panoramix/migrations/versions/2591d77e9831_user_id.py @@ -0,0 +1,27 @@ +"""user_id + +Revision ID: 2591d77e9831 +Revises: 12d55656cbca +Create Date: 2015-12-15 17:02:45.128709 + +""" + +# revision identifiers, used by Alembic. +revision = '2591d77e9831' +down_revision = '12d55656cbca' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + with op.batch_alter_table('tables') as batch_op: + batch_op.add_column(sa.Column('user_id', sa.Integer())) + batch_op.create_foreign_key('user_id', 'ab_user', ['user_id'], ['id']) + + +def downgrade(): + with op.batch_alter_table('tables'): + op.drop_constraint(None, 'tables', type_='foreignkey') + op.drop_column('tables', 'user_id') + diff --git a/panoramix/models.py b/panoramix/models.py index a4b3007ae5b64..a2357b27a95a6 100644 --- a/panoramix/models.py +++ b/panoramix/models.py @@ -229,6 +229,8 @@ class SqlaTable(Model, Queryable, AuditMixinNullable): default_endpoint = Column(Text) database_id = Column(Integer, ForeignKey('dbs.id'), nullable=False) is_featured = Column(Boolean, default=False) + user_id = Column(Integer, ForeignKey('ab_user.id')) + owner = relationship('User', backref='tables', foreign_keys=[user_id]) database = relationship( 'Database', backref='tables', foreign_keys=[database_id]) offset = Column(Integer, default=0) diff --git a/panoramix/static/featured_datasets.css b/panoramix/static/featured_datasets.css index a9067d4f3e0db..32a41147e8610 100644 --- a/panoramix/static/featured_datasets.css +++ b/panoramix/static/featured_datasets.css @@ -4,15 +4,14 @@ margin-bottom: 20px; } -.data-title{ - font-size: 26px; - font-weight: strong; +.small_table { + width: 170px; } -table { - border-bottom: 1px solid #dddddd; +#data-title{ + font-size: 20px; } -td { - vertical-align: middle; +#dataset-table { + border-bottom: 1px solid #dddddd; } diff --git a/panoramix/templates/panoramix/featured_datasets.html b/panoramix/templates/panoramix/featured_datasets.html index fb9f014690c76..83106307f4550 100644 --- a/panoramix/templates/panoramix/featured_datasets.html +++ b/panoramix/templates/panoramix/featured_datasets.html @@ -4,24 +4,38 @@
Table | Database | +Owner | +||
---|---|---|---|---|
- {{ dataset.table_name }}
+ {{ dataset.table_name }}
{{ dataset.description }}
|
- {{ dataset.database }} | +{{ dataset.database }} | +{{ dataset.owner }} | +