Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
module.exports = {
up: (migration, Types) => {
return migration.createTable('classification_roots', {
metric_id: {
type: Types.UUID,
allowNull: false,
unique: true,
primaryKey: true,
},
upload_id: {
type: Types.UUID,
allowNull: false,
references: {
model: 'uploads',
key: 'id',
},
},
image_id: {
type: Types.UUID,
allowNull: false,
},
url: {
type: Types.TEXT,
allowNull: false,
},
status: {
type: Types.TEXT,
allowNull: false,
defaultValue: 'pending',
},
meta: {
type: Types.JSONB,
defaultValue: {},
allowNull: false,
},
created_at: {
type: Types.DATE,
defaultValue: Types.fn('now'),
allowNull: false,
},
updated_at: {
type: Types.DATE,
defaultValue: Types.fn('now'),
allowNull: false,
},
deleted_at: {
type: Types.DATE,
defaultValue: null,
allowNull: true,
},
})
},
down: (migration, Types) => {
return migration.dropTable('')
},
}