diff options
Diffstat (limited to 'db/migrate/20221202144210_create_achievements.rb')
-rw-r--r-- | db/migrate/20221202144210_create_achievements.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/db/migrate/20221202144210_create_achievements.rb b/db/migrate/20221202144210_create_achievements.rb new file mode 100644 index 00000000000..30b2fd528ee --- /dev/null +++ b/db/migrate/20221202144210_create_achievements.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class CreateAchievements < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + create_table :achievements do |t| + t.references :namespace, + null: false, + index: false, + foreign_key: { on_delete: :cascade } + t.timestamps_with_timezone null: false + t.text :name, null: false, limit: 255 + t.text :avatar, limit: 255 + t.text :description, limit: 1024 + t.boolean :revokeable, default: false, null: false + t.index 'namespace_id, LOWER(name)', unique: true + end + end + + def down + drop_table :achievements + end +end |