Ensure reports have an issue id and a user id

This commit is contained in:
Andy Allan 2018-03-14 15:24:16 +08:00
parent 5e7abf67fb
commit 3e5a4a14df
3 changed files with 6 additions and 4 deletions

View file

@ -21,8 +21,8 @@ class CreateIssuesAndReports < ActiveRecord::Migration[5.0]
add_index :issues, :updated_by
create_table :reports do |t|
t.integer :issue_id
t.integer :user_id
t.integer :issue_id, :null => false
t.integer :user_id, :null => false
t.text :details, :null => false
t.string :category, :null => false
t.timestamps :null => false

View file

@ -1064,8 +1064,8 @@ CREATE TABLE relations (
CREATE TABLE reports (
id integer NOT NULL,
issue_id integer,
user_id integer,
issue_id integer NOT NULL,
user_id integer NOT NULL,
details text NOT NULL,
category character varying NOT NULL,
created_at timestamp without time zone NOT NULL,