@@ -3,20 +3,33 @@ def change
33 execute 'CREATE SCHEMA mass'
44
55 create_table 'mass.ext_entity' , id : false do |t |
6- t . bigint :ext_id , primary_key : true
6+ t . bigint :ext_id , primary_key : true
7+
78 t . text :acc_type , null : false
89 t . text :ref_name , null : false
910 t . integer :status , null : false
1011 end
1112
1213 create_table 'mass.ext_permit' , id : false do |t |
13- t . bigint :per_id , primary_key : true
14+ t . bigint :per_id , primary_key : true
15+
1416 t . bigint :ext_id , null : false
1517 t . text :submitter_id , null : false
1618 end
1719
20+ create_table 'mass.meta_entity' , id : false do |t |
21+ t . bigint :meta_id , primary_key : true
22+
23+ t . bigint :acc_id , null : false
24+ t . integer :meta_version , null : false
25+ t . text :type , null : false
26+ t . text :content , null : false
27+ t . timestamp :date , null : false , default : -> { "DATE_TRUNC('second', NOW())" }
28+ end
29+
1830 create_table 'mass.operation_history' , id : false do |t |
19- t . bigint :his_id , primary_key : true
31+ t . bigint :his_id , primary_key : true
32+
2033 t . integer :type , null : false
2134 t . text :summary , null : false
2235 t . text :file_name
@@ -34,7 +47,8 @@ def change
3447 end
3548
3649 create_table 'mass.submission' , id : false do |t |
37- t . bigint :sub_id , primary_key : true
50+ t . bigint :sub_id , primary_key : true
51+
3852 t . bigint :usr_id , null : false
3953 t . text :submitter_id , null : false
4054 t . integer :serial , null : false
0 commit comments