diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-08-19 17:08:03 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-08-19 17:08:03 +0000 |
commit | 725036669cca45df17f1acbb1a45a031a1a84c85 (patch) | |
tree | f8fae23c197b4db87ed8ed3f387f943c17492b2f /db | |
parent | 8fc800cbcc9994ccf8e582df2e94e8e27b5e6fbe (diff) | |
parent | 1e00e4369d316d079e31227d4a45ad2101553ec2 (diff) | |
download | gitlab-ce-725036669cca45df17f1acbb1a45a031a1a84c85.tar.gz |
Merge branch 'expiration-date-on-memberships' into 'master'
Expiration date on memberships
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/17495
See merge request !5876
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20160801163421_add_expires_at_to_member.rb | 29 | ||||
-rw-r--r-- | db/migrate/20160818205718_add_expires_at_to_project_group_links.rb | 29 | ||||
-rw-r--r-- | db/schema.rb | 6 |
3 files changed, 62 insertions, 2 deletions
diff --git a/db/migrate/20160801163421_add_expires_at_to_member.rb b/db/migrate/20160801163421_add_expires_at_to_member.rb new file mode 100644 index 00000000000..8db0fc60c4b --- /dev/null +++ b/db/migrate/20160801163421_add_expires_at_to_member.rb @@ -0,0 +1,29 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddExpiresAtToMember < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + # When a migration requires downtime you **must** uncomment the following + # constant and define a short and easy to understand explanation as to why the + # migration requires downtime. + # DOWNTIME_REASON = '' + + # When using the methods "add_concurrent_index" or "add_column_with_default" + # you must disable the use of transactions as these methods can not run in an + # existing transaction. When using "add_concurrent_index" make sure that this + # method is the _only_ method called in the migration, any other changes + # should go in a separate migration. This ensures that upon failure _only_ the + # index creation fails and can be retried or reverted easily. + # + # To disable transactions uncomment the following line and remove these + # comments: + # disable_ddl_transaction! + + def change + add_column :members, :expires_at, :date + end +end diff --git a/db/migrate/20160818205718_add_expires_at_to_project_group_links.rb b/db/migrate/20160818205718_add_expires_at_to_project_group_links.rb new file mode 100644 index 00000000000..0ed538b0df8 --- /dev/null +++ b/db/migrate/20160818205718_add_expires_at_to_project_group_links.rb @@ -0,0 +1,29 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddExpiresAtToProjectGroupLinks < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + # When a migration requires downtime you **must** uncomment the following + # constant and define a short and easy to understand explanation as to why the + # migration requires downtime. + # DOWNTIME_REASON = '' + + # When using the methods "add_concurrent_index" or "add_column_with_default" + # you must disable the use of transactions as these methods can not run in an + # existing transaction. When using "add_concurrent_index" make sure that this + # method is the _only_ method called in the migration, any other changes + # should go in a separate migration. This ensures that upon failure _only_ the + # index creation fails and can be retried or reverted easily. + # + # To disable transactions uncomment the following line and remove these + # comments: + # disable_ddl_transaction! + + def change + add_column :project_group_links, :expires_at, :date + end +end diff --git a/db/schema.rb b/db/schema.rb index 82d4590f6b5..748c4adc889 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160817154936) do +ActiveRecord::Schema.define(version: 20160818205718) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -568,6 +568,7 @@ ActiveRecord::Schema.define(version: 20160817154936) do t.string "invite_token" t.datetime "invite_accepted_at" t.datetime "requested_at" + t.date "expires_at" end add_index "members", ["access_level"], name: "index_members_on_access_level", using: :btree @@ -783,6 +784,7 @@ ActiveRecord::Schema.define(version: 20160817154936) do t.datetime "created_at" t.datetime "updated_at" t.integer "group_access", default: 30, null: false + t.date "expires_at" end create_table "project_import_data", force: :cascade do |t| @@ -1149,4 +1151,4 @@ ActiveRecord::Schema.define(version: 20160817154936) do add_foreign_key "protected_branch_merge_access_levels", "protected_branches" add_foreign_key "protected_branch_push_access_levels", "protected_branches" add_foreign_key "u2f_registrations", "users" -end +end
\ No newline at end of file |