lib/generators/motor/templates/install.rb in motor-admin-0.3.17 vs lib/generators/motor/templates/install.rb in motor-admin-0.4.0

- old
+ new

@@ -153,10 +153,82 @@ name: 'motor_api_configs_name_unique_index', unique: true, where: 'deleted_at IS NULL' end + create_table :motor_notes do |t| + t.column :body, :text + t.column :author_id, :bigint + t.column :author_type, :string + t.column :record_id, :string, null: false + t.column :record_type, :string, null: false + t.column :deleted_at, :datetime + + t.timestamps + + t.index %i[author_id author_type], + name: 'motor_notes_author_id_author_type_index' + end + + create_table :motor_note_tags do |t| + t.column :name, :string, null: false + + t.timestamps + + t.index 'name', + name: 'motor_note_tags_name_unique_index', + unique: true + end + + create_table :motor_note_tag_tags do |t| + t.references :tag, null: false, foreign_key: { to_table: :motor_note_tags }, index: true + t.references :note, null: false, foreign_key: { to_table: :motor_notes }, index: false + + t.index %i[note_id tag_id], + name: 'motor_note_tags_note_id_tag_id_index', + unique: true + end + + create_table :motor_reminders do |t| + t.column :author_id, :bigint, null: false + t.column :author_type, :string, null: false + t.column :recipient_id, :bigint, null: false + t.column :recipient_type, :string, null: false + t.column :record_id, :string + t.column :record_type, :string + t.column :scheduled_at, :datetime, null: false, index: true + + t.timestamps + + t.index %i[author_id author_type], + name: 'motor_reminders_author_id_author_type_index' + + t.index %i[recipient_id recipient_type], + name: 'motor_reminders_recipient_id_recipient_type_index' + + t.index %i[record_id record_type], + name: 'motor_reminders_record_id_record_type_index' + end + + create_table :motor_notifications do |t| + t.column :title, :string, null: false + t.column :description, :text + t.column :recipient_id, :bigint, null: false + t.column :recipient_type, :string, null: false + t.column :record_id, :string + t.column :record_type, :string + t.column :status, :string, null: false + + t.timestamps + + t.index %i[recipient_id recipient_type], + name: 'motor_notifications_recipient_id_recipient_type_index' + + t.index %i[record_id record_type], + name: 'motor_notifications_record_id_record_type_index' + end + add_index :motor_audits, %i[auditable_type auditable_id version], name: 'motor_auditable_index' add_index :motor_audits, %i[associated_type associated_id], name: 'motor_auditable_associated_index' add_index :motor_audits, %i[user_id user_type], name: 'motor_auditable_user_index' add_index :motor_audits, :request_uuid add_index :motor_audits, :created_at @@ -185,7 +257,12 @@ drop_table :motor_resources drop_table :motor_configs drop_table :motor_queries drop_table :motor_dashboards drop_table :motor_api_configs + drop_table :motor_note_tag_tags + drop_table :motor_note_tags + drop_table :motor_notes + drop_table :motor_notifications + drop_table :motor_reminders end end