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')