diff options
| author | Nathan Perry <avaglir@gmail.com> | 2018-04-05 15:25:44 -0400 |
|---|---|---|
| committer | Nathan Perry <avaglir@gmail.com> | 2018-04-05 15:25:44 -0400 |
| commit | 5b025763c42f9ab43d0cd67c52298b7d6f43e036 (patch) | |
| tree | 279c79392236050554237cb842ec4c00b556ec41 | |
| parent | 85b615602da9288aff57ae91042a0e01f4d3549b (diff) | |
add image/audio unique indexes
| -rw-r--r-- | migrations/2018-04-05-190159_add_data_indexes/down.sql | 2 | ||||
| -rw-r--r-- | migrations/2018-04-05-190159_add_data_indexes/up.sql | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/migrations/2018-04-05-190159_add_data_indexes/down.sql b/migrations/2018-04-05-190159_add_data_indexes/down.sql new file mode 100644 index 0000000..6fed43d --- /dev/null +++ b/migrations/2018-04-05-190159_add_data_indexes/down.sql @@ -0,0 +1,2 @@ +DROP INDEX audio_data; +DROP INDEX image_data; diff --git a/migrations/2018-04-05-190159_add_data_indexes/up.sql b/migrations/2018-04-05-190159_add_data_indexes/up.sql new file mode 100644 index 0000000..c3bff74 --- /dev/null +++ b/migrations/2018-04-05-190159_add_data_indexes/up.sql @@ -0,0 +1,4 @@ +-- note: pgcrypto extension must exist for this database + +CREATE UNIQUE INDEX audio_data ON audio (digest(data, 'sha1')); +CREATE UNIQUE INDEX image_data ON images (digest(data, 'sha1')); |
