diff options
author | Imre Farkas <ifarkas@gitlab.com> | 2019-02-20 14:39:37 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-02-20 14:39:37 +0300 |
commit | 6d92a3d4e232d4137f66773c82f01c32d7474a21 (patch) | |
tree | b3fda377c51504a6d21da1742cac3de7fd668ef0 /db/post_migrate | |
parent | 83a23297bdeb5086ecc96d86b2e264dd3591022d (diff) |
Remove undigested token column from personal_access_tokens table
Token column are no longer used as token values are stored digested in
token_digest.
Diffstat (limited to 'db/post_migrate')
-rw-r--r-- | db/post_migrate/20181101091005_steal_digest_column.rb | 17 | ||||
-rw-r--r-- | db/post_migrate/20181101091124_remove_token_from_personal_access_tokens.rb | 11 |
2 files changed, 28 insertions, 0 deletions
diff --git a/db/post_migrate/20181101091005_steal_digest_column.rb b/db/post_migrate/20181101091005_steal_digest_column.rb new file mode 100644 index 00000000000..58ea710c18a --- /dev/null +++ b/db/post_migrate/20181101091005_steal_digest_column.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class StealDigestColumn < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + Gitlab::BackgroundMigration.steal('DigestColumn') + end + + def down + # raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/post_migrate/20181101091124_remove_token_from_personal_access_tokens.rb b/db/post_migrate/20181101091124_remove_token_from_personal_access_tokens.rb new file mode 100644 index 00000000000..415373068d5 --- /dev/null +++ b/db/post_migrate/20181101091124_remove_token_from_personal_access_tokens.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RemoveTokenFromPersonalAccessTokens < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + remove_column :personal_access_tokens, :token, :string + end +end |