Skip to content

Commit

Permalink
DBマイグレーションを実施
Browse files Browse the repository at this point in the history
  • Loading branch information
1021ky committed Oct 1, 2024
1 parent 99f3f2b commit aa00ea4
Show file tree
Hide file tree
Showing 44 changed files with 229 additions and 60 deletions.
5 changes: 5 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_HOST: 127.0.0.1
DB_PORT: 5432
DB_NAME_TEST: test
34 changes: 23 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,49 @@ source 'https://rubygems.org'

ruby '3.3.4'

gem 'rails', '~> 6.1.7', '>= 6.1.7.8'
gem 'bcrypt', '~> 3.1.7'
gem 'jbuilder', '~> 2.7'
gem 'pg', '~> 1.1'
gem 'puma', '~> 5.0'
gem 'rails', '~> 6.1.7', '>= 6.1.7.8'
gem 'redis', '~> 4.0'
gem 'sass-rails', '>= 6'
gem 'webpacker', '~> 5.0'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.7'
gem 'redis', '~> 4.0'
gem 'bcrypt', '~> 3.1.7'
gem 'webpacker', '~> 5.0'

gem 'dotenv-rails'

gem 'bootsnap', '>= 1.4.4', require: false

group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'byebug', platforms: %i[mri mingw x64_mingw]
end

group :development do
gem 'web-console', '>= 4.1.0'
gem 'rack-mini-profiler', '~> 2.0'
gem 'base64' # for rubocop
gem 'bigdecimal' # for rubocop
gem 'debug'
gem 'factory_bot'
gem 'listen', '~> 3.3'
gem 'mutex_m' # for rubocop
gem 'rack-mini-profiler', '~> 2.0'
gem 'rubocop'
gem 'rubocop-rails'
# gem 'sorbet'
# gem 'sorbet-runtime'
gem 'spring'
gem 'stringio'
# gem 'watchman' # for sorbe
gem 'web-console', '>= 4.1.0'
gem 'webrick' # for dbmigrate
end

group :test do
gem 'capybara', '>= 3.26'
gem 'factory_bot_rails'
gem 'rspec-rails'
gem 'selenium-webdriver', '>= 4.0.0.rc1'
gem 'webdrivers'
gem 'rspec-rails'
gem 'factory_bot_rails'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
54 changes: 54 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ GEM
zeitwerk (~> 2.3)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
base64 (0.2.0)
bcrypt (3.1.20)
bigdecimal (3.1.5)
bindex (0.8.1)
bootsnap (1.18.4)
msgpack (~> 1.2)
Expand All @@ -80,6 +83,9 @@ GEM
concurrent-ruby (1.3.4)
crass (1.0.6)
date (3.3.4)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
diff-lcs (1.5.1)
dotenv (3.1.4)
dotenv-rails (3.1.4)
Expand All @@ -101,9 +107,15 @@ GEM
activesupport (>= 6.1)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jbuilder (2.13.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
json (2.7.2)
language_server-protocol (3.17.0.3)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
Expand All @@ -121,6 +133,7 @@ GEM
mini_mime (1.1.5)
minitest (5.25.1)
msgpack (1.7.2)
mutex_m (0.2.0)
net-imap (0.4.16)
date
net-protocol
Expand All @@ -143,7 +156,13 @@ GEM
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
pg (1.5.8)
psych (5.1.2)
stringio
public_suffix (6.0.1)
puma (5.6.9)
nio4r (~> 2.0)
Expand Down Expand Up @@ -183,12 +202,17 @@ GEM
method_source
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rdoc (6.7.0)
psych (>= 4.0.0)
redis (4.8.1)
regexp_parser (2.9.2)
reline (0.5.10)
io-console (~> 0.5)
rexml (3.3.7)
rspec-core (3.13.1)
rspec-support (~> 3.13.0)
Expand All @@ -207,6 +231,24 @@ GEM
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
rubocop (1.66.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
parser (>= 3.3.1.0)
rubocop-rails (2.26.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
rubyzip (2.3.2)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
Expand All @@ -231,6 +273,7 @@ GEM
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
stringio (3.1.1)
thor (1.3.2)
tilt (2.4.0)
timeout (0.4.1)
Expand All @@ -239,6 +282,7 @@ GEM
turbolinks-source (5.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand All @@ -253,6 +297,7 @@ GEM
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
webrick (1.8.2)
websocket (1.2.11)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
Expand All @@ -270,28 +315,37 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
base64
bcrypt (~> 3.1.7)
bigdecimal
bootsnap (>= 1.4.4)
byebug
capybara (>= 3.26)
debug
dotenv-rails
factory_bot
factory_bot_rails
jbuilder (~> 2.7)
listen (~> 3.3)
mutex_m
pg (~> 1.1)
puma (~> 5.0)
rack-mini-profiler (~> 2.0)
rails (~> 6.1.7, >= 6.1.7.8)
redis (~> 4.0)
rspec-rails
rubocop
rubocop-rails
sass-rails (>= 6)
selenium-webdriver (>= 4.0.0.rc1)
spring
stringio
turbolinks (~> 5)
tzinfo-data
web-console (>= 4.1.0)
webdrivers
webpacker (~> 5.0)
webrick

RUBY VERSION
ruby 3.3.4p94
Expand Down
1 change: 1 addition & 0 deletions app/channels/application_cable/channel.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
Expand Down
1 change: 1 addition & 0 deletions app/channels/application_cable/connection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/top_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# typed: strict
class Admin::TopController < ApplicationController
end
1 change: 1 addition & 0 deletions app/controllers/api/top_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: false
class Api::TopController < ApplicationController
def index
render action ":index"
Expand Down
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# typed: strict
class ApplicationController < ActionController::Base
end
1 change: 1 addition & 0 deletions app/controllers/tweet/top_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: true
class Tweet::TopController < ApplicationController
def index
render action: "index"
Expand Down
1 change: 1 addition & 0 deletions app/controllers/user/top_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: false
class User::TopController < ApplicationController
def index
render action ":index"
Expand Down
1 change: 1 addition & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# typed: strict
module ApplicationHelper
end
1 change: 1 addition & 0 deletions app/jobs/application_job.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
Expand Down
1 change: 1 addition & 0 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: false
class ApplicationMailer < ActionMailer::Base
default from: '[email protected]'
layout 'mailer'
Expand Down
1 change: 1 addition & 0 deletions app/models/application_record.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
3 changes: 3 additions & 0 deletions app/models/x_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# typed: strict
class XUser < ApplicationRecord
end
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
require_relative "boot"
# アプリケーションの設定を記述するファイル
# 設定はhttps://railsguides.jp/v6.1/configuring.htmlを参照
Expand Down
1 change: 1 addition & 0 deletions config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require "bundler/setup" # Set up gems listed in the Gemfile.
Expand Down
1 change: 1 addition & 0 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
# Load the Rails application.
require_relative "application"

Expand Down
1 change: 1 addition & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
require "active_support/core_ext/integer/time"

Rails.application.configure do
Expand Down
1 change: 1 addition & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
require "active_support/core_ext/integer/time"

Rails.application.configure do
Expand Down
1 change: 1 addition & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
require "active_support/core_ext/integer/time"

# The test environment is used exclusively to run your application's
Expand Down
1 change: 1 addition & 0 deletions config/initializers/application_controller_renderer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
# Be sure to restart your server when you modify this file.

# ActiveSupport::Reloader.to_prepare do
Expand Down
1 change: 1 addition & 0 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: false
# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/backtrace_silencers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
# Be sure to restart your server when you modify this file.

# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/content_security_policy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
# Be sure to restart your server when you modify this file.

# Define an application-wide content security policy
Expand Down
1 change: 1 addition & 0 deletions config/initializers/cookies_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: false
# Be sure to restart your server when you modify this file.

# Specify a serializer for the signed and encrypted cookie jars.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
# Be sure to restart your server when you modify this file.

# Configure sensitive parameters which will be filtered from the log file.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/inflections.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
# Be sure to restart your server when you modify this file.

# Add new inflection rules using the following format. Inflections
Expand Down
1 change: 1 addition & 0 deletions config/initializers/mime_types.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
# Be sure to restart your server when you modify this file.

# Add new mime types for use in respond_to blocks:
Expand Down
1 change: 1 addition & 0 deletions config/initializers/permissions_policy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
# Define an application-wide HTTP permissions policy. For further
# information see https://developers.google.com/web/updates/2018/06/feature-policy
#
Expand Down
1 change: 1 addition & 0 deletions config/initializers/wrap_parameters.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
# Be sure to restart your server when you modify this file.

# This file contains settings for ActionController::ParamsWrapper which
Expand Down
1 change: 1 addition & 0 deletions config/puma.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: false
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: strict
Rails.application.routes.draw do
# 名前空間の名前を定義すると、URLのパスにその名前空間が追加される
namespace :api do
Expand Down
1 change: 1 addition & 0 deletions config/spring.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: false
Spring.watch(
".ruby-version",
".rbenv-vars",
Expand Down
Loading

0 comments on commit aa00ea4

Please sign in to comment.