Add some constraint at database level (#342)

* Add some constraint at database level

Fixes #79 and should fix #201 and #113 as well

* Fix tests

Delete duplicated data before adding constraints (only with Postgres, there is no way to do it with Sqlite with complex constraints like the one we are using)

Remove the constraint on media path

* We don't need to drop the media unique constraint anymore

Because we deleted it
This commit is contained in:
Baptiste Gelez
2018-12-09 18:44:26 +01:00
committed by GitHub
parent b73fbd3768
commit 61b6ceed92
8 changed files with 568 additions and 102 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ pub(crate) mod tests {
let conn = &db();
conn.test_transaction::<_, (), _>(|| {
let searcher = get_searcher();
let blog = &fill_database(conn)[0];
let blog = &fill_database(conn).1[0];
let author = &blog.list_authors(conn)[0];
let title = random_hex()[..8].to_owned();