Add editable contents table

This commit is contained in:
Râu Cao 2025-05-28 18:39:25 +04:00
parent c7a21c7a69
commit 5c8ffc2630
Signed by: raucao
GPG Key ID: 37036C356E56CC51
3 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,4 @@
class EditableContent < ApplicationRecord
validates :key, presence: true,
uniqueness: { scope: :path }
end

View 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

View File

@ -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