mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 14:27:57 +01:00 
			
		
		
		
	Fix fresh database installs
(cherry picked from commit 70bbede29e0f995436d86f50ab14ace837839a6c)
This commit is contained in:
		| @@ -11,7 +11,7 @@ CREATE TABLE chapters( | ||||
|     source_order INTEGER NOT NULL, | ||||
|     date_fetch INTEGER AS Long NOT NULL, | ||||
|     date_upload INTEGER AS Long NOT NULL, | ||||
|     last_modified_at INTEGER AS Long NOT NULL, | ||||
|     last_modified_at INTEGER AS Long NOT NULL DEFAULT 0, | ||||
|     FOREIGN KEY(manga_id) REFERENCES mangas (_id) | ||||
|     ON DELETE CASCADE | ||||
| ); | ||||
|   | ||||
| @@ -23,14 +23,14 @@ CREATE TABLE mangas( | ||||
|     date_added INTEGER AS Long NOT NULL, | ||||
|     update_strategy INTEGER AS UpdateStrategy NOT NULL DEFAULT 0, | ||||
|     calculate_interval INTEGER DEFAULT 0 NOT NULL, | ||||
|     last_modified_at INTEGER AS Long NOT NULL, | ||||
|     last_modified_at INTEGER AS Long NOT NULL DEFAULT 0, | ||||
|     favorite_modified_at INTEGER AS Long | ||||
| ); | ||||
|  | ||||
| CREATE INDEX library_favorite_index ON mangas(favorite) WHERE favorite = 1; | ||||
| CREATE INDEX mangas_url_index ON mangas(url); | ||||
|  | ||||
| CREATE TRIGGER update_favorite_modified_at_mangas | ||||
| CREATE TRIGGER update_last_favorited_at_mangas | ||||
| AFTER UPDATE OF favorite ON mangas | ||||
| BEGIN | ||||
|   UPDATE mangas | ||||
|   | ||||
| @@ -2,7 +2,7 @@ CREATE TABLE mangas_categories( | ||||
|     _id INTEGER NOT NULL PRIMARY KEY, | ||||
|     manga_id INTEGER NOT NULL, | ||||
|     category_id INTEGER NOT NULL, | ||||
|     last_modified_at INTEGER AS Long NOT NULL, | ||||
|     last_modified_at INTEGER AS Long NOT NULL DEFAULT 0, | ||||
|     FOREIGN KEY(category_id) REFERENCES categories (_id) | ||||
|     ON DELETE CASCADE, | ||||
|     FOREIGN KEY(manga_id) REFERENCES mangas (_id) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user