差分

移動先: 案内検索

Tep3

362 バイト追加, 2022年2月24日 (木) 06:52
ListsのidをClientsのlist_idに入れる
64 | 2 | 1 | 1060 | 2597 | 70 | 101 | t | f | t | t | f | f | 2019-03-07 16:16:19.197973 | 2021-08-25 23:47:50.265849 | | | | t | t | t | t | f
</pre>
* 旧CategoriesとPropertiesをjoinしてie_id(新Clientsのidは旧ie_id)とlist_idを抜き出す
<pre>
エクスポート
\COPY (select properties.ie_id as id, categories.id as list_id from categories join properties on categories.id = properties.tiku_id where categories.jiin_id = 1 order by properties.ie_id asc) TO '/Users/jq/3tep_gomi/ie_id_list_id_1.csv' WITH CSV DELIMITER ',' FORCE QUOTE * NULL AS '' HEADER;
</pre>
* tep3_developmentデータベース内に作業用一時テーブルを作る Clientsのlist_idに上で抜き出したlist_idを入れるため
<pre>
CREATE TABLE x_list_id (client_id int, list_id int);
</pre>
<pre>
インポート
\COPY x_list_id(client_id, list_id) FROM '/Users/jq/3tep_gomi/ie_id_list_id_1.csv' WITH CSV DELIMITER ',';
</pre>
* Clientsをアップデートしてlist_idを入れる
<pre>
アップデート
UPDATE clients SET list_id = x_list_id.list_id FROM x_list_id WHERE clients.id = x_list_id.client_id;
</pre>

案内メニュー