Przeglądaj źródła

res_index migration

visuddhinanda 4 lat temu
rodzic
commit
39c991f4dc

+ 4 - 0
db/postgresql/migrations/2021-11-20-084233_res_index/down.sql

@@ -0,0 +1,4 @@
+-- This file should undo anything in `up.sql`
+DROP INDEX IF EXISTS res_index_title ;
+DROP INDEX IF EXISTS res_index_title_en ;
+DROP TABLE res_index ;

+ 27 - 0
db/postgresql/migrations/2021-11-20-084233_res_index/up.sql

@@ -0,0 +1,27 @@
+-- Your SQL goes here
+
+CREATE TABLE res_index 
+(
+	id SERIAL PRIMARY KEY,
+	book INTEGER, 
+	paragraph INTEGER, 
+	title VARCHAR (1024), 
+	title_en VARCHAR (1024),  
+	level INTEGER, 
+	type INTEGER, 
+	language VARCHAR (16), 
+	author VARCHAR (256), 
+	editor INTEGER, 
+	share INTEGER, 
+	edition INTEGER NOT NULL DEFAULT 1, 
+	hit INTEGER DEFAULT 0 NOT NULL, 
+	album INTEGER, 
+	tag VARCHAR (1024), 
+	summary VARCHAR (1024), 
+	create_time bigint, 
+	update_time bigint
+);
+
+
+CREATE INDEX res_index_title ON res_index (title);
+CREATE INDEX res_index_title_en ON res_index (title_en);