From bdf4641c43956c981d3db9cec40d3f96a71b1bf9 Mon Sep 17 00:00:00 2001 From: wangyan Date: Wed, 5 Jul 2017 03:34:40 -0700 Subject: [PATCH] update user realname update --- tools/migration/changelog.md | 3 ++- tools/migration/migration_harbor/versions/1_2_0.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/migration/changelog.md b/tools/migration/changelog.md index ac279b560..20ea6d8e2 100644 --- a/tools/migration/changelog.md +++ b/tools/migration/changelog.md @@ -44,4 +44,5 @@ Changelog for harbor database schema - delete column `user_id` from table `access_log` - delete foreign key (user_id) references user(user_id)from table `access_log` - delete foreign key (project_id) references project(project_id)from table `access_log` - - add column `username` varchar (32) to table `access_log` \ No newline at end of file + - add column `username` varchar (32) to table `access_log` + - alter column `realname` on table `user`: varchar(20)->varchar(255) \ No newline at end of file diff --git a/tools/migration/migration_harbor/versions/1_2_0.py b/tools/migration/migration_harbor/versions/1_2_0.py index 05c712f1d..5c41509fd 100644 --- a/tools/migration/migration_harbor/versions/1_2_0.py +++ b/tools/migration/migration_harbor/versions/1_2_0.py @@ -38,6 +38,8 @@ def upgrade(): """ bind = op.get_bind() session = Session(bind=bind) + + op.alter_column('user', 'realname', type_=sa.String(255), existing_type=sa.String(20)) #delete column access_log.user_id(access_log_ibfk_1), access_log.project_id(access_log_ibfk_2) op.drop_constraint('access_log_ibfk_1', 'access_log', type_='foreignkey')