Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration for foorm library model #38681

Merged
merged 3 commits into from
Jan 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions dashboard/app/models/foorm/library.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# == Schema Information
#
# Table name: foorm_libraries
#
# id :bigint not null, primary key
# name :string(255) not null
# version :integer not null
# published :boolean default(TRUE), not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_foorm_libraries_on_multiple_fields (name,version) UNIQUE
#
class Foorm::Library < ApplicationRecord
end
13 changes: 13 additions & 0 deletions dashboard/db/migrate/20210121195951_create_foorm_libraries.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class CreateFoormLibraries < ActiveRecord::Migration[5.2]
def change
create_table :foorm_libraries do |t|
t.string :name, null: false
t.integer :version, null: false
t.boolean :published, null: false

t.timestamps

t.index [:name, :version], name: "index_foorm_libraries_on_multiple_fields", unique: true
end
end
end
11 changes: 10 additions & 1 deletion dashboard/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2021_01_08_224326) do
ActiveRecord::Schema.define(version: 2021_01_21_195951) do

create_table "activities", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.integer "user_id"
Expand Down Expand Up @@ -464,6 +464,15 @@
t.index ["name", "version"], name: "index_foorm_forms_on_name_and_version", unique: true
end

create_table "foorm_libraries", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "name", null: false
t.integer "version", null: false
t.boolean "published", default: true, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["name", "version"], name: "index_foorm_libraries_on_multiple_fields", unique: true
end

create_table "foorm_library_questions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "library_name", null: false
t.integer "library_version", null: false
Expand Down