forked from mirrors/catstodon
add emoji reaction database model
parent
8380f9fc2c
commit
0da3340f0d
@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: emoji_reactions
|
||||
#
|
||||
# id :bigint(8) not null, primary key
|
||||
# emoji :string
|
||||
# status_id :bigint(8) not null
|
||||
# account_id :bigint(8) not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
class EmojiReaction < ApplicationRecord
|
||||
belongs_to :status
|
||||
belongs_to :account
|
||||
end
|
@ -0,0 +1,11 @@
|
||||
class CreateEmojiReactions < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :emoji_reactions do |t|
|
||||
t.string :emoji
|
||||
t.references :status, null: false, foreign_key: true
|
||||
t.references :account, null: false, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
Fabricator(:emoji_reaction) do
|
||||
emoji "MyString"
|
||||
status nil
|
||||
account nil
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe EmojiReaction, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in New Issue