-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENG-11253: create partial unique index on template
- Loading branch information
Showing
3 changed files
with
13 additions
and
7 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
db/migration/202012091055-add-partial-unique-constraint-on-template.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package migration | ||
|
||
import migrate "github.com/rubenv/sql-migrate" | ||
|
||
func Get202012091055() *migrate.Migration { | ||
return &migrate.Migration{ | ||
Id: "202012091055-add-partial-unique-constraint-on-template", | ||
Up: []string{` | ||
CREATE UNIQUE INDEX uidx_template_name ON template (name) WHERE deleted_at IS NULL; | ||
`}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters