Add support to choose the sheet within google spreadsheets

This commit is contained in:
2020-06-10 15:50:15 +02:00
parent 7eb0ca6753
commit e64fa197aa
6 changed files with 91 additions and 71 deletions

View File

@@ -0,0 +1,5 @@
class AddGoogleSpreadsheetSheetToForms < ActiveRecord::Migration[6.0]
def change
add_column :forms, :google_spreadsheet_sheet, :string
end
end

View File

@@ -1,5 +1,3 @@
# frozen_string_literal: true
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@@ -12,83 +10,85 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20_200_413_152_532) do
ActiveRecord::Schema.define(version: 2020_06_10_131725) do
# These are extensions that must be enabled in order to support this database
enable_extension 'plpgsql'
enable_extension "plpgsql"
create_table 'active_storage_attachments', force: :cascade do |t|
t.string 'name', null: false
t.string 'record_type', null: false
t.bigint 'record_id', null: false
t.bigint 'blob_id', null: false
t.datetime 'created_at', null: false
t.string 'token'
t.index ['blob_id'], name: 'index_active_storage_attachments_on_blob_id'
t.index %w[record_type record_id name blob_id], name: 'index_active_storage_attachments_uniqueness', unique: true
t.index ['token'], name: 'index_active_storage_attachments_on_token', unique: true
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.string "token"
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
t.index ["token"], name: "index_active_storage_attachments_on_token", unique: true
end
create_table 'active_storage_blobs', force: :cascade do |t|
t.string 'key', null: false
t.string 'filename', null: false
t.string 'content_type'
t.text 'metadata'
t.bigint 'byte_size', null: false
t.string 'checksum', null: false
t.datetime 'created_at', null: false
t.index ['key'], name: 'index_active_storage_blobs_on_key', unique: true
create_table "active_storage_blobs", force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.bigint "byte_size", null: false
t.string "checksum", null: false
t.datetime "created_at", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
create_table 'authentications', force: :cascade do |t|
t.integer 'user_id'
t.datetime 'expires_at'
t.datetime 'created_at', precision: 6, null: false
t.datetime 'updated_at', precision: 6, null: false
t.text 'access_token_ciphertext'
t.text 'refresh_token_ciphertext'
t.string 'provider'
t.string 'uid'
create_table "authentications", force: :cascade do |t|
t.integer "user_id"
t.datetime "expires_at"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.text "access_token_ciphertext"
t.text "refresh_token_ciphertext"
t.string "provider"
t.string "uid"
end
create_table 'forms', force: :cascade do |t|
t.integer 'user_id'
t.string 'google_spreadsheet_id'
t.string 'title'
t.string 'token'
t.string 'thank_you_url'
t.datetime 'created_at', precision: 6, null: false
t.datetime 'updated_at', precision: 6, null: false
t.string 'airtable_app_key_ciphertext'
t.string 'airtable_api_key_ciphertext'
t.string 'airtable_table'
t.string 'backend_name'
create_table "forms", force: :cascade do |t|
t.integer "user_id"
t.string "google_spreadsheet_id"
t.string "title"
t.string "token"
t.string "thank_you_url"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "airtable_app_key_ciphertext"
t.string "airtable_api_key_ciphertext"
t.string "airtable_table"
t.string "backend_name"
t.string "google_spreadsheet_sheet"
end
create_table 'submissions', force: :cascade do |t|
t.integer 'form_id'
t.json 'data', default: {}
t.datetime 'appended_at'
t.datetime 'created_at', precision: 6, null: false
t.datetime 'updated_at', precision: 6, null: false
t.string 'remote_ip'
t.string 'referrer'
t.integer 'sequential_id'
create_table "submissions", force: :cascade do |t|
t.integer "form_id"
t.json "data", default: {}
t.datetime "appended_at"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "remote_ip"
t.string "referrer"
t.integer "sequential_id"
end
create_table 'users', force: :cascade do |t|
t.string 'email'
t.string 'name'
t.string 'google_id'
t.datetime 'created_at', precision: 6, null: false
t.datetime 'updated_at', precision: 6, null: false
t.string 'crypted_password'
t.string 'salt'
t.string 'magic_login_token'
t.datetime 'magic_login_token_expires_at'
t.datetime 'magic_login_email_sent_at'
t.index ['email'], name: 'index_users_on_email', unique: true
t.index ['magic_login_token'], name: 'index_users_on_magic_login_token'
create_table "users", force: :cascade do |t|
t.string "email"
t.string "name"
t.string "google_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "crypted_password"
t.string "salt"
t.string "magic_login_token"
t.datetime "magic_login_token_expires_at"
t.datetime "magic_login_email_sent_at"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["magic_login_token"], name: "index_users_on_magic_login_token"
end
add_foreign_key 'active_storage_attachments', 'active_storage_blobs', column: 'blob_id'
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
end