Add editable contents table
This commit is contained in:
parent
c7a21c7a69
commit
5c8ffc2630
4
app/models/editable_content.rb
Normal file
4
app/models/editable_content.rb
Normal file
@ -0,0 +1,4 @@
|
||||
class EditableContent < ApplicationRecord
|
||||
validates :key, presence: true,
|
||||
uniqueness: { scope: :path }
|
||||
end
|
13
db/migrate/20250528092931_create_editable_contents.rb
Normal file
13
db/migrate/20250528092931_create_editable_contents.rb
Normal file
@ -0,0 +1,13 @@
|
||||
class CreateEditableContents < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :editable_contents do |t|
|
||||
t.string :path
|
||||
t.string :key
|
||||
t.string :lang, default: "en"
|
||||
t.text :content
|
||||
t.boolean :rich_text, default: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
12
db/schema.rb
12
db/schema.rb
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_05_27_113805) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_05_28_092931) do
|
||||
create_table "active_storage_attachments", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "record_type", null: false
|
||||
@ -64,6 +64,16 @@ ActiveRecord::Schema[8.0].define(version: 2025_05_27_113805) do
|
||||
t.index ["user_id"], name: "index_donations_on_user_id"
|
||||
end
|
||||
|
||||
create_table "editable_contents", force: :cascade do |t|
|
||||
t.string "path"
|
||||
t.string "key"
|
||||
t.string "lang", default: "en"
|
||||
t.text "content"
|
||||
t.boolean "rich_text", default: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "flipper_features", force: :cascade do |t|
|
||||
t.string "key", null: false
|
||||
t.datetime "created_at", null: false
|
||||
|
Loading…
x
Reference in New Issue
Block a user