Skip to content

Add sprints table and barebones model

Mario de la Ossa requested to merge 205570-sprint_initial_migrations into master

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

Availability and Testing

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

Merge request reports