Sha256: a7e91d123a4e1f21a6b7470f5ce61951d512d687f4f7a5536a116dc99c9ef581

Contents?: true

Size: 341 Bytes

Versions: 2

Compression:

Stored size: 341 Bytes

Contents

class CreatePosts < ActiveRecord::Migration[7.0]
  def change
    create_table :posts do |t|
      t.string :title 
      t.text :content 
      t.bigint :author_id, null: false
      t.datetime :deleted_at

      t.timestamps
    end

    add_index :posts, :author_id, unique: true
    add_index :posts, :deleted_at, unique: true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
n_base_rails-0.1.2 lib/db/migrate/20230227135020_create_posts.rb
n_base_rails-0.1.1 lib/db/migrate/20230227135020_create_posts.rb