@@ -28,6 +28,10 @@ CREATE TABLE spaces (
28
28
INDEX updated (updated)
29
29
);
30
30
31
+ -- Note: The `proposals` table schema might have some discrepancies
32
+ -- compared to the production database. This is due to legacy reasons
33
+ -- and the challenges associated with updating the schema because of its size.
34
+ -- `id` and `ipfs` columns should not have any default values.
31
35
CREATE TABLE proposals (
32
36
id VARCHAR (66 ) NOT NULL ,
33
37
ipfs VARCHAR (64 ) NOT NULL ,
@@ -36,8 +40,8 @@ CREATE TABLE proposals (
36
40
updated INT (11 ) DEFAULT NULL ,
37
41
space VARCHAR (64 ) NOT NULL ,
38
42
network VARCHAR (12 ) NOT NULL ,
39
- symbol VARCHAR (16 ) NOT NULL ,
40
- type VARCHAR (24 ) NOT NULL ,
43
+ symbol VARCHAR (16 ) NOT NULL DEFAULT ' ' ,
44
+ type VARCHAR (24 ) NOT NULL DEFAULT ' ' ,
41
45
strategies JSON NOT NULL ,
42
46
validation JSON NOT NULL ,
43
47
plugins JSON NOT NULL ,
@@ -49,17 +53,20 @@ CREATE TABLE proposals (
49
53
start INT (11 ) NOT NULL ,
50
54
end INT (11 ) NOT NULL ,
51
55
quorum DECIMAL (64 ,30 ) NOT NULL ,
52
- quorum_type VARCHAR (24 ) NOT NULL DEFAULT ' ' ,
56
+ quorum_type VARCHAR (24 ) DEFAULT ' ' ,
53
57
privacy VARCHAR (24 ) NOT NULL ,
54
58
snapshot INT (24 ) NOT NULL ,
55
59
app VARCHAR (24 ) NOT NULL ,
56
60
scores JSON NOT NULL ,
57
61
scores_by_strategy JSON NOT NULL ,
58
- scores_state VARCHAR (24 ) NOT NULL ,
62
+ scores_state VARCHAR (24 ) NOT NULL DEFAULT ' ' ,
59
63
scores_total DECIMAL (64 ,30 ) NOT NULL ,
60
64
scores_updated INT (11 ) NOT NULL ,
65
+ scores_total_value DECIMAL (64 ,30 ) NOT NULL DEFAULT ' 0.000000000000000000000000000000' ,
66
+ vp_value_by_strategy json NOT NULL ,
61
67
votes INT (12 ) NOT NULL ,
62
68
flagged INT NOT NULL DEFAULT 0 ,
69
+ cb INT NOT NULL DEFAULT 0 ,
63
70
PRIMARY KEY (id),
64
71
INDEX ipfs (ipfs),
65
72
INDEX author (author),
@@ -73,7 +80,8 @@ CREATE TABLE proposals (
73
80
INDEX scores_state (scores_state),
74
81
INDEX scores_updated (scores_updated),
75
82
INDEX votes (votes),
76
- INDEX flagged (flagged)
83
+ INDEX flagged (flagged),
84
+ INDEX cb (cb)
77
85
);
78
86
79
87
CREATE TABLE votes (
0 commit comments