Moving to github

This commit is contained in:
2026-03-28 19:24:29 -04:00
commit 036fa7ab33
302 changed files with 17838 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
class CreateCollections < ActiveRecord::Migration[8.1]
def change
create_table :collections do |t|
t.references :user, null: false, foreign_key: true, index: true
t.string :name, null: false
t.text :description
t.integer :parent_collection_id
t.timestamps
end
add_index :collections, :parent_collection_id
add_foreign_key :collections, :collections, column: :parent_collection_id
# Enable Row Level Security
execute <<-SQL
ALTER TABLE collections ENABLE ROW LEVEL SECURITY;
CREATE POLICY collections_isolation_policy ON collections
USING (user_id = current_setting('app.current_user_id', true)::bigint);
SQL
end
end