Sfoglia il codice sorgente

table rename sent_sim_index->sent_sim_indexs

visuddhinanda 4 anni fa
parent
commit
75061516a9

+ 1 - 1
app/config.sample.php

@@ -203,7 +203,7 @@ php ./app/pali_sent/redis_upgrade_pali_sent.php
 //PostgreSQL
 define("_FILE_DB_PALI_SENTENCE_SIM_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
 define("_TABLE_SENT_SIM_", "sent_sims");
-define("_TABLE_SENT_SIM_INDEX_", "sent_sim_index");
+define("_TABLE_SENT_SIM_INDEX_", "sent_sim_indexs");
 
 define("_SRC_DB_PALI_SENTENCE_SIM_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_sim.db3");
 

+ 1 - 1
db/postgresql/migrations/2021-11-28-011427_sent_sim_index/down.sql

@@ -1,2 +1,2 @@
 
-DROP TABLE sent_sim_index ;
+DROP TABLE sent_sim_indexs ;

+ 2 - 1
db/postgresql/migrations/2021-11-28-011427_sent_sim_index/up.sql

@@ -1,6 +1,6 @@
 
 -- 表:sent_sim_index
-CREATE TABLE sent_sim_index 
+CREATE TABLE sent_sim_indexs
 (
     id SERIAL PRIMARY KEY,
 	sent_id INTEGER,
@@ -8,3 +8,4 @@ CREATE TABLE sent_sim_index
     created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
 );
 
+CREATE UNIQUE INDEX sent_sim_indexs_sent_id ON sent_sim_indexs (sent_id);