Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Create an ActiveRecord-backed Schema model #608

Draft
wants to merge 3 commits into
base: big-postgres-refactor
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ gem 'jbuilder', '~> 2.9'
gem 'sdoc', '~> 2.1', group: :doc

gem 'foreman', '~> 0.87'
gem 'pg', '~> 0.18'

group :production do
gem 'thin', '~> 1.8'
gem 'rails_12factor', '~> 0.0'
gem 'puma', '~> 5.2'
gem 'pg', '~> 1.2'
end

group :development, :test do
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ GEM
open_uri_redirections (0.2.1)
optimist (3.0.1)
origin (2.3.1)
pg (1.2.3)
pg (0.21.0)
poltergeist (1.6.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
Expand Down Expand Up @@ -822,7 +822,7 @@ DEPENDENCIES
mongo (~> 2.1)!
mongoid (~> 5.1)
nokogiri (~> 1.10)
pg (~> 1.2)
pg (~> 0.18)
poltergeist (~> 1.6)
pry (~> 0.14)
puma (~> 5.2)
Expand Down
2 changes: 2 additions & 0 deletions app/models/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Schema < ActiveRecord::Base
end
9 changes: 9 additions & 0 deletions db/migrate/20210422223019_create_schemas.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class CreateSchemas < ActiveRecord::Migration
def change
create_table :schemas do |t|
t.string :url

t.timestamps null: false
end
end
end
8 changes: 7 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 0) do
ActiveRecord::Schema.define(version: 20210422223019) do

create_table "schemas", force: :cascade do |t|
t.string "url"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

end
5 changes: 5 additions & 0 deletions spec/models/schema_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'spec_helper'

RSpec.describe Schema, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end