From 6075a395e5945e91bca831adbf3e24f4ed2b10b7 Mon Sep 17 00:00:00 2001 From: liwen <408815583@qq.com> Date: Tue, 12 May 2020 16:57:36 +0800 Subject: [PATCH 1/3] feat: first commit --- Gemfile | 6 +++++- Gemfile.lock | 7 +++++-- app/models/note.rb | 2 ++ config/database.yml | 31 +++++++++++++++++++++++++------ 4 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 app/models/note.rb diff --git a/Gemfile b/Gemfile index 4e7a435..6ac57f9 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,9 @@ ruby '2.4.1' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.2' -gem 'pg', '>= 0.18', '< 2.0' +# gem 'pg', '>= 0.18', '< 2.0' +gem "mysql2", group: :mysql + # Use Puma as the app server gem 'puma', '~> 3.11' # Use SCSS for stylesheets @@ -18,6 +20,8 @@ gem 'uglifier', '>= 1.3.0' gem 'bootsnap', '>= 1.1.0', require: false +gem 'awesome_nested_set' + group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'listen', '>= 3.0.5', '< 3.2' diff --git a/Gemfile.lock b/Gemfile.lock index fa04232..5ebae81 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,6 +51,8 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) arel (9.0.0) + awesome_nested_set (3.2.0) + activerecord (>= 4.0.0, < 7.0) bootsnap (1.4.0) msgpack (~> 1.0) builder (3.2.3) @@ -80,10 +82,10 @@ GEM mini_portile2 (2.4.0) minitest (5.11.3) msgpack (1.2.6) + mysql2 (0.5.3) nio4r (2.3.1) nokogiri (1.10.1) mini_portile2 (~> 2.4.0) - pg (1.1.4) puma (3.12.0) rack (2.0.6) rack-test (1.1.0) @@ -151,9 +153,10 @@ PLATFORMS DEPENDENCIES annotate! + awesome_nested_set bootsnap (>= 1.1.0) listen (>= 3.0.5, < 3.2) - pg (>= 0.18, < 2.0) + mysql2 puma (~> 3.11) rails (~> 5.2.2) sass-rails (~> 5.0) diff --git a/app/models/note.rb b/app/models/note.rb new file mode 100644 index 0000000..b6b1e5a --- /dev/null +++ b/app/models/note.rb @@ -0,0 +1,2 @@ +class Note < ApplicationRecord +end diff --git a/config/database.yml b/config/database.yml index f5ce3e7..8fe05fd 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,10 +1,29 @@ -default: &default - adapter: postgresql - encoding: unicode +# default: &default +# adapter: postgresql +# encoding: unicode +# pool: 5 +# username: postgres +# password: postgres + +# development: +# <<: *default +# database: gitos_development + +production: + adapter: mysql2 + encoding: utf8 + reconnect: false + database: gitos_development pool: 5 - username: postgres - password: postgres + username: root + password: "root" development: - <<: *default + adapter: mysql2 + encoding: utf8 + reconnect: false database: gitos_development + pool: 5 + username: root + password: "root" + -- Gitee From 3b62c16e5ec097ae5cb67e96edc245943705bf2b Mon Sep 17 00:00:00 2001 From: liwen <408815583@qq.com> Date: Tue, 12 May 2020 17:02:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20remove=20=E7=AC=AC=E5=8D=81?= =?UTF-8?q?=E8=A1=8C=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 3 +-- test/fixtures/notes.yml | 11 +++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/notes.yml diff --git a/Gemfile b/Gemfile index 6ac57f9..ed6a5f5 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,6 @@ ruby '2.4.1' gem 'rails', '~> 5.2.2' # gem 'pg', '>= 0.18', '< 2.0' -gem "mysql2", group: :mysql # Use Puma as the app server gem 'puma', '~> 3.11' @@ -26,4 +25,4 @@ group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'listen', '>= 3.0.5', '< 3.2' gem 'annotate', github: 'ctran/annotate_models' -end \ No newline at end of file +end diff --git a/test/fixtures/notes.yml b/test/fixtures/notes.yml new file mode 100644 index 0000000..80aed36 --- /dev/null +++ b/test/fixtures/notes.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value -- Gitee From fce1341fedcd3f15a17ff96d0659a51613514f6e Mon Sep 17 00:00:00 2001 From: liwen <408815583@qq.com> Date: Tue, 12 May 2020 17:33:45 +0800 Subject: [PATCH 3/3] feat: rm Gemfile --- Gemfile | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 Gemfile diff --git a/Gemfile b/Gemfile deleted file mode 100644 index ed6a5f5..0000000 --- a/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source 'https://gems.ruby-china.com' -git_source(:github) { |repo| "https://github.com/#{repo}.git" } - -ruby '2.4.1' - -# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 5.2.2' - -# gem 'pg', '>= 0.18', '< 2.0' - -# Use Puma as the app server -gem 'puma', '~> 3.11' -# Use SCSS for stylesheets -gem 'sass-rails', '~> 5.0' -# Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '>= 1.3.0' -# See https://github.com/rails/execjs#readme for more supported runtimes -# gem 'mini_racer', platforms: :ruby - -gem 'bootsnap', '>= 1.1.0', require: false - -gem 'awesome_nested_set' - -group :development do - # Access an interactive console on exception pages or by calling 'console' anywhere in the code. - gem 'listen', '>= 3.0.5', '< 3.2' - gem 'annotate', github: 'ctran/annotate_models' -end -- Gitee