Skip to content
Permalink
Browse files

Drop the content versions table

  • Loading branch information
mahesh-krishnakumar committed Feb 12, 2020
1 parent a31eddf commit 0d73ca5ea50c6ef880dda2fa9fdc289e8f3368a2
@@ -5,7 +5,6 @@ class ContentBlock < ApplicationRecord
BLOCK_TYPE_FILE = -'file'

has_one_attached :file
has_many :content_versions, dependent: :restrict_with_error
belongs_to :target_version

def self.valid_block_types

This file was deleted.

@@ -0,0 +1,14 @@
class DropContentVersions < ActiveRecord::Migration[6.0]
def up
drop_table :content_versions
end

def down
create_table :content_versions do |t|
t.references :target, foreign_key: true
t.references :content_block, foreign_key: true
t.date :version_on, index: true
t.integer :sort_index
end
end
end
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2020_01_23_122954) do
ActiveRecord::Schema.define(version: 2020_02_12_091203) do

# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
@@ -214,16 +214,6 @@
t.index ["target_version_id"], name: "index_content_blocks_on_target_version_id"
end

create_table "content_versions", force: :cascade do |t|
t.bigint "target_id"
t.bigint "content_block_id"
t.date "version_on"
t.integer "sort_index"
t.index ["content_block_id"], name: "index_content_versions_on_content_block_id"
t.index ["target_id"], name: "index_content_versions_on_target_id"
t.index ["version_on"], name: "index_content_versions_on_version_on"
end

create_table "course_authors", force: :cascade do |t|
t.bigint "user_id"
t.bigint "course_id"
@@ -842,8 +832,6 @@
add_foreign_key "connect_requests", "connect_slots"
add_foreign_key "connect_requests", "startups"
add_foreign_key "connect_slots", "faculty"
add_foreign_key "content_versions", "content_blocks"
add_foreign_key "content_versions", "targets"
add_foreign_key "course_authors", "courses"
add_foreign_key "course_authors", "users"
add_foreign_key "course_exports", "courses"

This file was deleted.

0 comments on commit 0d73ca5

Please sign in to comment.
You can’t perform that action at this time.