Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
Remove model change for grouper sync
Browse files Browse the repository at this point in the history
Summary: The issue with the diff was that we implemented the migration change and the model change in the same commit. This removes the model change. It also changes the migration code to make the column nullable for compatibility reasons (it is USUALLY a bad idea to edit the migration file, but since we haven't applied this anywhere, it should be fine)

Test Plan: tested locally, ran tests

Reviewers: anupc

Reviewed By: anupc

Subscribers: changesbot, kylec

Differential Revision: https://tails.corp.dropbox.com/D221771
  • Loading branch information
Naphat Sanguansin committed Aug 19, 2016
1 parent 6f023c8 commit 3aff514
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions changes/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from datetime import datetime
from sqlalchemy import Boolean, Column, String, DateTime
from sqlalchemy.dialects.postgresql import ARRAY

from changes.config import db
from changes.db.types.guid import GUID
Expand All @@ -19,13 +18,6 @@ class User(db.Model):
is_admin = Column(Boolean, default=False, nullable=False)
date_created = Column(DateTime, default=datetime.utcnow)

# this keeps track of the list of wildcard patterns of project names that
# the user has access to. For example:
# - `foo` matches `foo`
# - `foo.*` matches anything starting with `foo.`, like `foo.staging`, `foo.`
# - `*foo*` matches anything containing `foo`, like `barfoobar`, `foo`
project_permissions = Column(ARRAY(String(256)), nullable=False, default=[])

def __init__(self, **kwargs):
super(User, self).__init__(**kwargs)
if not self.id:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


def upgrade():
op.add_column('user', sa.Column('project_permissions', postgresql.ARRAY(sa.String(length=256)), nullable=False, default=[]))
op.add_column('user', sa.Column('project_permissions', postgresql.ARRAY(sa.String(length=256)), nullable=True))


def downgrade():
Expand Down

0 comments on commit 3aff514

Please sign in to comment.