Compare commits

...

4 Commits

Author SHA1 Message Date
0ed010b78f
fix errormessage 2021-04-01 10:02:12 +02:00
a6598ba5db clicks are deleted when connected links are
fixes #7
2021-04-01 10:00:16 +02:00
2fba9080d6 Revert "format migration"
as migrations store a hash it is not possible to change the
migrationfiles afterwards.

This reverts commit fdcc89ec1f.
2021-04-01 10:00:16 +02:00
053992e30c
Merge pull request #6 from enaut/WIP--translations
Make the page translatable
2021-03-31 16:50:13 +02:00
3 changed files with 28 additions and 5 deletions

View File

@ -1,5 +1,4 @@
-- Add migration script here
ALTER TABLE
users
ADD
COLUMN language Text NOT NULL DEFAULT "en";
ALTER TABLE users
ADD COLUMN language Text NOT NULL DEFAULT "en";

View File

@ -0,0 +1,24 @@
-- Add migration script here
PRAGMA foreign_keys = off;
CREATE TABLE new_clicks (
id INTEGER PRIMARY KEY NOT NULL,
link INT NOT NULL,
created_at TIMESTAMP NOT NULL,
FOREIGN KEY (link) REFERENCES links (id) ON DELETE CASCADE
);
INSERT INTO
new_clicks
SELECT
*
FROM
clicks;
DROP TABLE clicks;
ALTER TABLE
new_clicks RENAME TO clicks;
PRAGMA foreign_keys = on;

View File

@ -64,7 +64,7 @@ impl actix_web::error::ResponseError for ServerError {
match self {
Self::Argonautic => HttpResponse::InternalServerError().json("Argonautica Error"),
Self::Database(e) => {
HttpResponse::InternalServerError().json(format!("Diesel Error: {:?}", e))
HttpResponse::InternalServerError().json(format!("Database Error: {:?}", e))
}
Self::DatabaseMigration(_) => {
unimplemented!("A migration error should never be rendered")