add source to submissions
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddSourceToSubmissions < ActiveRecord::Migration[7.0]
|
||||
class MigrationSubmission < ApplicationRecord
|
||||
self.table_name = 'submissions'
|
||||
end
|
||||
|
||||
def up
|
||||
add_column :submissions, :source, :text
|
||||
|
||||
MigrationSubmission.where(source: nil).update_all(source: :invite)
|
||||
|
||||
change_column_null :submissions, :source, false
|
||||
end
|
||||
|
||||
def down
|
||||
drop_column :submissions, :source
|
||||
end
|
||||
end
|
||||
+2
-1
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_08_03_200825) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_08_05_124454) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
@@ -80,6 +80,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_03_200825) do
|
||||
t.text "template_fields"
|
||||
t.text "template_schema"
|
||||
t.text "template_submitters"
|
||||
t.text "source", null: false
|
||||
t.index ["created_by_user_id"], name: "index_submissions_on_created_by_user_id"
|
||||
t.index ["template_id"], name: "index_submissions_on_template_id"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user