「Tep3-onk」を編集中

移動先: 案内検索

警告: ログインしていません。編集を行うと、あなたの IP アドレスが公開されます。ログインまたはアカウントを作成すれば、あなたの編集はその利用者名とともに表示されるほか、その他の利点もあります。

この編集を取り消せます。 下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 編集中の文章
1行目: 1行目:
 
[[category:memo|{{PAGENAME}}]]
 
[[category:memo|{{PAGENAME}}]]
{{Font color}}
 
 
== generate ==
 
== generate ==
  
12行目: 11行目:
  
 
  % rails generate scaffold Other user:references note:references client:references name:string yomi:string client_name:boolean line:integer memo:text generation:string
 
  % rails generate scaffold Other user:references note:references client:references name:string yomi:string client_name:boolean line:integer memo:text generation:string
 
% rails generate scaffold List user:references note:references content:string line:integer
 
  
 
  $ rails generate scaffold Post content:text user:references picture:string
 
  $ rails generate scaffold Post content:text user:references picture:string
41行目: 38行目:
  
 
  $ rails db:migrate:up VERSION=20200504051127
 
  $ rails db:migrate:up VERSION=20200504051127
 
% rails db:migrate:reset
 
  
 
== postgres ==
 
== postgres ==
152行目: 147行目:
  
 
  =# update clients_old set ie_id = 6000 where ie_id = 2090 and jiin_id > 1;
 
  =# update clients_old set ie_id = 6000 where ie_id = 2090 and jiin_id > 1;
 
== 親テーブルie_id 子テーブルie_id 差分削除 ==
 
% diff aa_clients_id_ie_id.csv bb_clients_old_ie_id.csv > diff.csv
 
  
 
=== insert ===
 
=== insert ===
198行目: 190行目:
 
     id, name, yomi, ie_id, nusi, user_id, jiin_id, created_at, updated_at, memo, each_order, generation
 
     id, name, yomi, ie_id, nusi, user_id, jiin_id, created_at, updated_at, memo, each_order, generation
 
from
 
from
     clients_old;
+
     clients_old;</nowiki>
INSERT 0 4747</nowiki>
 
  
 
=== insert エラー ===
 
=== insert エラー ===
212行目: 203行目:
 
  % rails db:migrate:up VERSION=
 
  % rails db:migrate:up VERSION=
  
{{font color||yellow|後で本番環境も変更}}
 
 
不要
 
 
  =# delete from clients_old where id in (4028,3911,3912,2998,3007,4359);
 
  =# delete from clients_old where id in (4028,3911,3912,2998,3007,4359);
 
主重複
 
<nowiki> ie_id | count
 
-------+-------
 
  2282 |    2
 
  3703 |    2
 
(2 rows)
 
 
=# update clients_old set nusi = false where id = 1346;
 
 
=# update clients_old set nusi = false where id = 3703;</nowiki>
 
 
== {{font color||yellow|移動本番でも}} ==
 
update clients_old set nusi = true where id = 523;
 
 
delete from clients_old where id = 845;
 
 
<nowiki>update clients_old set ie_id = 1264 where id = 515;
 
update clients_old set ie_id = 1264 where id = 1463;
 
update clients_old set nusi = false where id = 515;</nowiki>
 
 
delete from clients_old where id = 217;
 
update clients_old set nusi = false where id = 218;
 
update clients_old set ie_id = 204 where id = 218;
 
 
delete from clients_old where id = 811;
 
 
update clients_old set nusi = true where id = 1792;
 
 
delete from clients_old where id = 810;
 
 
delete from clients_old where ie_id = 22653;
 
 
<nowiki>delete from clients_old where ie_id = 22653;
 
DELETE 3
 
tep5_development=# insert into others
 
(
 
    id, name, yomi, client_id, client_name, user_id, note_id, created_at, updated_at, memo, line, generation
 
)
 
select
 
    id, name, yomi, ie_id, nusi, user_id, jiin_id, created_at, updated_at, memo, each_order, generation
 
from
 
    clients_old;
 
INSERT 0 4747</nowiki>
 
  
 
=== 指定行を作る ===
 
=== 指定行を作る ===
278行目: 222行目:
 
;
 
;
 
UPDATE 3066</nowiki>
 
UPDATE 3066</nowiki>
 
=== 作業テーブル削除 ===
 
<nowiki>tep5_development=# drop table clients_old ;
 
DROP TABLE
 
tep5_development=# drop table jq_clients ;
 
DROP TABLE
 
tep5_development=# drop table users_old ;
 
DROP TABLE</nowiki>
 
  
 
== ローカル ==
 
== ローカル ==
411行目: 347行目:
  
 
== 同期 ==
 
== 同期 ==
 
+
% rsync -r ~/rails_app_tepnote/4tep/ host:/home/tep/
 
除外するファイルをまとめる
 
除外するファイルをまとめる
 
  <nowiki>exclude-file.txt
 
  <nowiki>exclude-file.txt
422行目: 358行目:
 
  $ bundle install  --without test development
 
  $ bundle install  --without test development
  
{{font color||yellow|database.yml username:などを確認する (2箇所)}}
+
database.yml username:などを確認する (2箇所)
 
 
{{font color||yellow|migrationファイルがダブったときは削除}}
 
 
 
$ rails db:migrate:status RAILS_ENV=production
 
  
 
  $ rails db:create RAILS_ENV=production
 
  $ rails db:create RAILS_ENV=production
 
  または
 
  または
 
  $ rails db:reset RAILS_ENV=production
 
  $ rails db:reset RAILS_ENV=production
または
 
$ rails db:drop  RAILS_ENV=production
 
または
 
=# drop database mydb;
 
  
 
エラーのとき
 
エラーのとき
454行目: 382行目:
  
 
== 参考 ==
 
== 参考 ==
  <nowiki>=# delete from clients_old where ie_id in (21,
+
  <nowiki>=# delete from clients_old where id in (977,
 
22,
 
22,
 
23,
 
23,
461行目: 389行目:
 
27,
 
27,
 
30,
 
30,
32,
+
533,
33,
+
266,
 
34,
 
34,
 
35,
 
35,
469行目: 397行目:
 
41,
 
41,
 
43,
 
43,
44,
+
459,
 
45,
 
45,
46,
+
989,
 
48,
 
48,
 
49,
 
49,
477行目: 405行目:
 
52,
 
52,
 
53,
 
53,
56,
+
990,
57,
+
697,
 
62,
 
62,
63,
+
297,
 
64,
 
64,
 
66,
 
66,
486行目: 414行目:
 
68,
 
68,
 
69,
 
69,
71,
+
978,
73,
+
704,
78,
+
793,
 
79,
 
79,
 
80,
 
80,
501行目: 429行目:
 
97,
 
97,
 
98,
 
98,
99,
+
517,
 
100,
 
100,
101,
+
974,
102,
+
269,
 
104,
 
104,
105,
+
1793)</nowiki>
106,
 
108,
 
109,
 
110,
 
111,
 
113,
 
115,
 
116,
 
117,
 
118,
 
121,
 
122,
 
123,
 
124,
 
126,
 
127,
 
128,
 
129,
 
131,
 
132,
 
133,
 
135,
 
136,
 
138,
 
139,
 
140,
 
141,
 
144,
 
145,
 
147,
 
148,
 
150,
 
151,
 
152,
 
153,
 
157,
 
158,
 
159,
 
161,
 
162,
 
166,
 
170,
 
171,
 
173,
 
174,
 
176,
 
177,
 
179,
 
180,
 
182,
 
183,
 
184,
 
185,
 
186,
 
188,
 
189,
 
190,
 
191,
 
192,
 
194,
 
197,
 
199,
 
201,
 
202,
 
205,
 
222,
 
228,
 
230,
 
231,
 
232,
 
249,
 
264,
 
272,
 
310,
 
355,
 
372,
 
373,
 
375,
 
404,
 
461,
 
472,
 
473,
 
490,
 
491,
 
531,
 
550,
 
561,
 
590,
 
649,
 
673,
 
674,
 
676,
 
679,
 
683,
 
686,
 
689,
 
691,
 
694,
 
701,
 
741,
 
754,
 
800,
 
802,
 
804,
 
805,
 
808,
 
814,
 
815,
 
821,
 
848,
 
872,
 
875,
 
876,
 
921,
 
923,
 
936,
 
953,
 
972,
 
993,
 
998,
 
1009,
 
1010,
 
1013,
 
2072,
 
5158,
 
6053)
 
DELETE 307</nowiki>
 

wikipokpokへの投稿はすべて、クリエイティブ・コモンズ 表示-継承 (詳細はWikipokpok:著作権を参照)のもとで公開したと見なされることにご注意ください。 自分が書いたものが他の人に容赦なく編集され、自由に配布されるのを望まない場合は、ここに投稿しないでください。
また、投稿するのは、自分で書いたものか、パブリック ドメインまたはそれに類するフリーな資料からの複製であることを約束してください。 著作権保護されている作品は、許諾なしに投稿しないでください!

このページを編集するには、下記の確認用の質問に回答してください (詳細):

取り消し | 編集の仕方 (新しいウィンドウで開きます)

このページで使用されているテンプレート: