「Tep3」の版間の差分

提供: wikipokpok
移動先: 案内検索
(データベース移行)
(エクスポート)
25行目: 25行目:
 
== データベース移行 ==
 
== データベース移行 ==
 
=== エクスポート ===
 
=== エクスポート ===
 +
\COPY (select ie_id, user_id, jiin_id, created_at, updated_at from clients where nusi = true order by jiin_id asc, ie_id asc) TO '/Users/jq/3tep_gomi/clients.csv' WITH CSV DELIMITER ',' FORCE QUOTE * NULL AS '' HEADER;
 +
 
  \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;
 
  \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;
 +
 
=== インポート ===
 
=== インポート ===
 
  \COPY notes(user_id, name, kind, meeting_time, role, created_at, updated_at) FROM '/Users/jq/3tep_gomi/notes.csv' WITH CSV DELIMITER ',';
 
  \COPY notes(user_id, name, kind, meeting_time, role, created_at, updated_at) FROM '/Users/jq/3tep_gomi/notes.csv' WITH CSV DELIMITER ',';
  
 
  \COPY others(user_id, note_id, client_id, name, yomi, nusi, order1, order2, generation, created_at, updated_at) FROM '/Users/jq/3tep_gomi/others.csv' WITH CSV DELIMITER ',';
 
  \COPY others(user_id, note_id, client_id, name, yomi, nusi, order1, order2, generation, created_at, updated_at) FROM '/Users/jq/3tep_gomi/others.csv' WITH CSV DELIMITER ',';

2022年2月22日 (火) 16:11時点における版

% ruby -v
% rbenv versions
% rbenv local 2.7.5
% rails -v
% rails new tep3 -d postgresql
database.yml username
rails db:create
$ yarn add bootstrap@next
$ yarn add @popperjs/core
app/javascript/packs/application.js
import "bootstrap";
import "../stylesheets/application";
% mkdir app/javascript/stylesheets/
% touch app/javascript/stylesheets/application.scss
@import "bootstrap";
app/views/layouts/application.html.erb
<%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>

データベース移行

エクスポート

\COPY (select ie_id, user_id, jiin_id, created_at, updated_at from clients where nusi = true order by jiin_id asc, ie_id asc) TO '/Users/jq/3tep_gomi/clients.csv' WITH CSV DELIMITER ',' FORCE QUOTE * NULL AS  HEADER;
\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;

インポート

\COPY notes(user_id, name, kind, meeting_time, role, created_at, updated_at) FROM '/Users/jq/3tep_gomi/notes.csv' WITH CSV DELIMITER ',';
\COPY others(user_id, note_id, client_id, name, yomi, nusi, order1, order2, generation, created_at, updated_at) FROM '/Users/jq/3tep_gomi/others.csv' WITH CSV DELIMITER ',';