mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-05 09:00:24 +00:00
[AB-263] adding stricter not null checks to database, disabling updates/inserts for created and updated columns to only rely on triggers
This commit is contained in:
@@ -9,10 +9,10 @@
|
||||
<changeSet author="Sheldan" id="posted_image-table">
|
||||
<createTable tableName="posted_image">
|
||||
<column name="message_id" type="BIGINT" >
|
||||
<constraints nullable="true"/>
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="position" type="INTEGER" >
|
||||
<constraints nullable="true"/>
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="author_user_in_server_id" type="BIGINT">
|
||||
<constraints nullable="false"/>
|
||||
@@ -27,7 +27,7 @@
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="created" type="TIMESTAMP WITHOUT TIME ZONE">
|
||||
<constraints nullable="true"/>
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="updated" type="TIMESTAMP WITHOUT TIME ZONE"/>
|
||||
</createTable>
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
<changeSet author="Sheldan" id="repost-table">
|
||||
<createTable tableName="repost">
|
||||
<column name="message_id" type="BIGINT" >
|
||||
<constraints nullable="true"/>
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="position" type="INTEGER" >
|
||||
<constraints nullable="true"/>
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="user_in_server_id" type="BIGINT">
|
||||
<constraints nullable="false"/>
|
||||
@@ -24,7 +24,7 @@
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="created" type="TIMESTAMP WITHOUT TIME ZONE">
|
||||
<constraints nullable="true"/>
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="updated" type="TIMESTAMP WITHOUT TIME ZONE"/>
|
||||
</createTable>
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
<changeSet author="Sheldan" id="repost_check_channel_group-table">
|
||||
<createTable tableName="repost_check_channel_group">
|
||||
<column name="id" type="BIGINT">
|
||||
<constraints nullable="true"/>
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="created" type="TIMESTAMP WITHOUT TIME ZONE">
|
||||
<constraints nullable="true"/>
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="updated" type="TIMESTAMP WITHOUT TIME ZONE"/>
|
||||
<column name="enabled" type="BOOLEAN">
|
||||
<constraints nullable="true"/>
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</createTable>
|
||||
<addForeignKeyConstraint baseColumnNames="id" baseTableName="repost_check_channel_group" constraintName="fk_repost_check_channel_group_group"
|
||||
|
||||
@@ -40,13 +40,13 @@ public class PostedImage {
|
||||
@Setter
|
||||
private PostIdentifier postId;
|
||||
|
||||
@Column(name = "image_hash")
|
||||
@Column(name = "image_hash", nullable = false)
|
||||
private String imageHash;
|
||||
|
||||
@Column(name = "created")
|
||||
@Column(name = "created", nullable = false, insertable = false, updatable = false)
|
||||
private Instant created;
|
||||
|
||||
@Column(name = "updated")
|
||||
@Column(name = "updated", insertable = false, updatable = false)
|
||||
private Instant updated;
|
||||
|
||||
@Getter
|
||||
|
||||
@@ -45,10 +45,10 @@ public class Repost {
|
||||
})
|
||||
private PostedImage originalPost;
|
||||
|
||||
@Column(name = "created")
|
||||
@Column(name = "created", nullable = false, insertable = false, updatable = false)
|
||||
private Instant created;
|
||||
|
||||
@Column(name = "updated")
|
||||
@Column(name = "updated", insertable = false, updatable = false)
|
||||
private Instant updated;
|
||||
|
||||
}
|
||||
|
||||
@@ -24,13 +24,14 @@ public class RepostCheckChannelGroup {
|
||||
@PrimaryKeyJoinColumn
|
||||
private AChannelGroup channelGroup;
|
||||
|
||||
@Column(name = "enabled")
|
||||
private Boolean checkEnabled;
|
||||
@Builder.Default
|
||||
@Column(name = "enabled", nullable = false)
|
||||
private Boolean checkEnabled = true;
|
||||
|
||||
@Column(name = "created")
|
||||
@Column(name = "created", nullable = false, insertable = false, updatable = false)
|
||||
private Instant created;
|
||||
|
||||
@Column(name = "updated")
|
||||
@Column(name = "updated", insertable = false, updatable = false)
|
||||
private Instant updated;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user