Add sprints table and barebones model
What does this MR do?
Migrations to create a Sprints table with all the necessary attributes - foreign keys/etc to come in following MRs
Please note changes in this MR have received approval from frontend and DB from !25658 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides - [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Database
Migrations up
== 20200213224220 AddSprints: migrating =======================================
-- create_table(:sprints, {:id=>:bigserial})
-> 0.0225s
== 20200213224220 AddSprints: migrated (0.0225s) ==============================
== 20200420172113 AddTextLimitToSprintsTitle: migrating =======================
-- transaction_open?()
-> 0.0000s
-- execute("ALTER TABLE sprints\nADD CONSTRAINT sprints_title\nCHECK ( char_length(title) <= 255 )\nNOT VALID;\n")
-> 0.0009s
-- execute("SET statement_timeout TO 0")
-> 0.0002s
-- execute("ALTER TABLE sprints VALIDATE CONSTRAINT sprints_title;")
-> 0.0005s
-- execute("RESET ALL")
-> 0.0002s
== 20200420172113 AddTextLimitToSprintsTitle: migrated (0.0094s) ==============
== 20200420172752 AddSprintsForeignKeyToProjects: migrating ===================
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:sprints)
-> 0.0030s
-- execute("ALTER TABLE sprints\nADD CONSTRAINT fk_e8206c9686\nFOREIGN KEY (project_id)\nREFERENCES projects (id)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0033s
-- execute("SET statement_timeout TO 0")
-> 0.0002s
-- execute("ALTER TABLE sprints VALIDATE CONSTRAINT fk_e8206c9686;")
-> 0.0110s
-- execute("RESET ALL")
-> 0.0002s
== 20200420172752 AddSprintsForeignKeyToProjects: migrated (0.0221s) ==========
== 20200420172927 AddSprintsForeignKeyToGroups: migrating =====================
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:sprints)
-> 0.0024s
-- execute("ALTER TABLE sprints\nADD CONSTRAINT fk_80aa8a1f95\nFOREIGN KEY (group_id)\nREFERENCES namespaces (id)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0010s
-- execute("SET statement_timeout TO 0")
-> 0.0002s
-- execute("ALTER TABLE sprints VALIDATE CONSTRAINT fk_80aa8a1f95;")
-> 0.0046s
-- execute("RESET ALL")
-> 0.0002s
== 20200420172927 AddSprintsForeignKeyToGroups: migrated (0.0098s) ============
Migrations down
== 20200420172927 AddSprintsForeignKeyToGroups: reverting =====================
-- remove_foreign_key(:sprints, {:column=>:group_id})
-> 0.0047s
== 20200420172927 AddSprintsForeignKeyToGroups: reverted (0.0119s) ============
== 20200420172752 AddSprintsForeignKeyToProjects: reverting ===================
-- remove_foreign_key(:sprints, {:column=>:project_id})
-> 0.0032s
== 20200420172752 AddSprintsForeignKeyToProjects: reverted (0.0046s) ==========
== 20200420172113 AddTextLimitToSprintsTitle: reverting =======================
-- execute("ALTER TABLE sprints\nDROP CONSTRAINT IF EXISTS sprints_title\n")
-> 0.0004s
== 20200420172113 AddTextLimitToSprintsTitle: reverted (0.0019s) ==============
== 20200213224220 AddSprints: reverting =======================================
-- drop_table(:sprints, {:id=>:bigserial})
-> 0.0026s
== 20200213224220 AddSprints: reverted (0.0082s) ==============================
Refs #205570 (closed)
Edited by Mayra Cabrera