差分

Tep3

242 バイト追加, 2022年2月23日 (水) 12:20
データベース移行
</pre>
==== ClientsをClientsとOthersに分ける ====
*新clients(家テーブル) 旧Clientsから主を抜き出す ie_idを新Clientsのidにする そのidにOthersがぶらさがる* 今回はスキーマを変更したので寺ごとに出し入れする
<pre>
エクスポート\COPY (select ie_id, user_id, jiin_id, created_at, updated_at from clients where jiin_id = 1 and nusi = true order by ie_id asc, jiin_id asc) TO '/Users/jq/3tep_gomi/clients_1.csv' WITH CSV DELIMITER ',' FORCE QUOTE * NULL AS '' HEADER; \COPY (select ie_id, user_id, jiin_id, created_at, updated_at from clients where jiin_id = 2 and nusi = true order by ie_id asc, jiin_id asc) TO '/Users/jq/3tep_gomi/clientsclients_2.csv' WITH CSV DELIMITER ',' FORCE QUOTE * NULL AS '' HEADER; ...
</pre>
<pre>
\COPY (select user_id, jiin_id, ie_id, name, yomi, nusi, each_order, table_order, generation, created_at, updated_at from clients order by jiin_id asc, ie_id asc) TO '/Users/jq/3tep_gomi/others.csv' WITH CSV DELIMITER ',' FORCE QUOTE * NULL AS '' HEADER;
</pre>
<pre>