mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
21 lines
474 B
Ruby
21 lines
474 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateComments < ActiveRecord::Migration
|
|
def self.up
|
|
create_table :comments do |t|
|
|
t.string :title, limit: 50, default: ''
|
|
t.text :comment
|
|
t.references :commentable, polymorphic: true
|
|
t.references :user
|
|
t.timestamps
|
|
end
|
|
|
|
add_index :comments, :commentable_type
|
|
add_index :comments, :commentable_id
|
|
add_index :comments, :user_id
|
|
end
|
|
|
|
def self.down
|
|
drop_table :comments
|
|
end
|
|
end
|