Skip to content

Commit c3570a6

Browse files
committed
rails g model active_storage_file_blob key:string:uniq data:binary
1 parent 137b92f commit c3570a6

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ActiveStorageFileBlob < ApplicationRecord
2+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class CreateActiveStorageFileBlobs < ActiveRecord::Migration[8.0]
2+
def change
3+
create_table :active_storage_file_blobs do |t|
4+
t.string :key
5+
t.binary :data
6+
7+
t.timestamps
8+
end
9+
add_index :active_storage_file_blobs, :key, unique: true
10+
end
11+
end

db/schema.rb

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2+
3+
one:
4+
key: MyString
5+
data:
6+
7+
two:
8+
key: MyString
9+
data:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require "test_helper"
2+
3+
class ActiveStorageFileBlobTest < ActiveSupport::TestCase
4+
# test "the truth" do
5+
# assert true
6+
# end
7+
end

0 commit comments

Comments
 (0)