Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Update decidim to active_storage_migration branch
Browse files Browse the repository at this point in the history
  • Loading branch information
leio10 committed Jun 30, 2021
1 parent 7a2b14c commit df5f337
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source "https://rubygems.org"

ruby RUBY_VERSION

DECIDIM_VERSION = { git: "https://github.com/decidim/decidim", branch: "develop" }
DECIDIM_VERSION = { git: "https://github.com/decidim/decidim", branch: "active_storage_migration" }

gem "decidim", DECIDIM_VERSION
#gem "decidim-conferences", DECIDIM_VERSION
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/decidim/decidim
revision: 39de071f4f6c16fad8115101882b4c568dfe86f0
branch: develop
revision: c1f8db7ed0b6638a6eb59568925ec7a19d61e2a9
branch: active_storage_migration
specs:
decidim (0.25.0.dev)
decidim-accountability (= 0.25.0.dev)
Expand Down
30 changes: 30 additions & 0 deletions db/migrate/20210630085615_create_active_storage_tables.decidim.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# frozen_string_literal: true
# This migration comes from decidim (originally 20210309190009)

# This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
def change
create_table :active_storage_blobs 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], unique: true
end

create_table :active_storage_attachments do |t|
t.string :name, null: false
t.references :record, null: false, polymorphic: true, index: false
t.references :blob, null: false

t.datetime :created_at, null: false

t.index [:record_type, :record_id, :name, :blob_id], name: "index_active_storage_attachments_uniqueness", unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This migration comes from decidim (originally 20210407190753)

class AllowNullOrganizationLogoColumnInOAuthApplicationsTable < ActiveRecord::Migration[6.0]
def change
change_column_null :oauth_applications, :organization_logo, true
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true
# This migration comes from decidim (originally 20210419165805)

class CreateDecidimContentBlockAttachments < ActiveRecord::Migration[6.0]
def change
create_table :decidim_content_block_attachments do |t|
t.string :name
t.references :decidim_content_block, null: false, index: { name: "decidim_content_block_attachments_on_content_block" }
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This migration comes from decidim_participatory_processes (originally 20210415163339)

class AllowNullFileColumnInDecidimAttachmentsTable < ActiveRecord::Migration[6.0]
def change
change_column_null :decidim_attachments, :file, true
end
end
34 changes: 31 additions & 3 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,34 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2021_06_28_083105) do
ActiveRecord::Schema.define(version: 2021_06_30_085618) do

# These are extensions that must be enabled in order to support this database
enable_extension "ltree"
enable_extension "pg_trgm"
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.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
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
end

create_table "decidim_accountability_results", id: :serial, force: :cascade do |t|
t.jsonb "title"
t.jsonb "description"
Expand Down Expand Up @@ -237,7 +258,7 @@
create_table "decidim_attachments", id: :serial, force: :cascade do |t|
t.jsonb "title", null: false
t.jsonb "description"
t.string "file", null: false
t.string "file"
t.string "content_type", null: false
t.string "file_size", null: false
t.integer "attached_to_id", null: false
Expand Down Expand Up @@ -648,6 +669,12 @@
t.index ["decidim_user_group_id"], name: "index_decidim_consultations_votes_on_decidim_user_group_id"
end

create_table "decidim_content_block_attachments", force: :cascade do |t|
t.string "name"
t.bigint "decidim_content_block_id", null: false
t.index ["decidim_content_block_id"], name: "decidim_content_block_attachments_on_content_block"
end

create_table "decidim_content_blocks", force: :cascade do |t|
t.integer "decidim_organization_id", null: false
t.string "manifest_name", null: false
Expand Down Expand Up @@ -2084,7 +2111,7 @@
t.string "name", null: false
t.string "organization_name", null: false
t.string "organization_url", null: false
t.string "organization_logo", null: false
t.string "organization_logo"
t.string "uid", null: false
t.string "secret", null: false
t.text "redirect_uri", null: false
Expand All @@ -2110,6 +2137,7 @@
t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
end

add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "decidim_area_types", "decidim_organizations"
add_foreign_key "decidim_areas", "decidim_area_types", column: "area_type_id"
add_foreign_key "decidim_areas", "decidim_organizations"
Expand Down

0 comments on commit df5f337

Please sign in to comment.