diff --git a/dao/generated-src/jooq/main/java/com/databasir/dao/Databasir.java b/dao/generated-src/jooq/main/java/com/databasir/dao/Databasir.java index b561dec..7623c38 100644 --- a/dao/generated-src/jooq/main/java/com/databasir/dao/Databasir.java +++ b/dao/generated-src/jooq/main/java/com/databasir/dao/Databasir.java @@ -10,6 +10,7 @@ import com.databasir.dao.tables.DatabaseDocument; import com.databasir.dao.tables.DatabaseType; import com.databasir.dao.tables.DocumentDescription; import com.databasir.dao.tables.DocumentDiscussion; +import com.databasir.dao.tables.DocumentTemplateProperty; import com.databasir.dao.tables.Group; import com.databasir.dao.tables.Login; import com.databasir.dao.tables.OauthApp; @@ -78,6 +79,11 @@ public class Databasir extends SchemaImpl { */ public final DocumentDiscussion DOCUMENT_DISCUSSION = DocumentDiscussion.DOCUMENT_DISCUSSION; + /** + * template property + */ + public final DocumentTemplateProperty DOCUMENT_TEMPLATE_PROPERTY = DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY; + /** * The table databasir.group. */ @@ -180,6 +186,7 @@ public class Databasir extends SchemaImpl { DatabaseType.DATABASE_TYPE, DocumentDescription.DOCUMENT_DESCRIPTION, DocumentDiscussion.DOCUMENT_DISCUSSION, + DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY, Group.GROUP, Login.LOGIN, OauthApp.OAUTH_APP, diff --git a/dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java b/dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java index a3184ef..5853b13 100644 --- a/dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java +++ b/dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java @@ -10,6 +10,7 @@ import com.databasir.dao.tables.DatabaseDocument; import com.databasir.dao.tables.DatabaseType; import com.databasir.dao.tables.DocumentDescription; import com.databasir.dao.tables.DocumentDiscussion; +import com.databasir.dao.tables.DocumentTemplateProperty; import com.databasir.dao.tables.Group; import com.databasir.dao.tables.Login; import com.databasir.dao.tables.OauthApp; @@ -32,6 +33,7 @@ import com.databasir.dao.tables.records.DatabaseDocumentRecord; import com.databasir.dao.tables.records.DatabaseTypeRecord; import com.databasir.dao.tables.records.DocumentDescriptionRecord; import com.databasir.dao.tables.records.DocumentDiscussionRecord; +import com.databasir.dao.tables.records.DocumentTemplatePropertyRecord; import com.databasir.dao.tables.records.GroupRecord; import com.databasir.dao.tables.records.LoginRecord; import com.databasir.dao.tables.records.OauthAppRecord; @@ -75,6 +77,8 @@ public class Keys { public static final UniqueKey KEY_DOCUMENT_DESCRIPTION_PRIMARY = Internal.createUniqueKey(DocumentDescription.DOCUMENT_DESCRIPTION, DSL.name("KEY_document_description_PRIMARY"), new TableField[] { DocumentDescription.DOCUMENT_DESCRIPTION.ID }, true); public static final UniqueKey KEY_DOCUMENT_DESCRIPTION_UK_PROJECT_ID_TABLE_NAME_COLUMN_NAME = Internal.createUniqueKey(DocumentDescription.DOCUMENT_DESCRIPTION, DSL.name("KEY_document_description_uk_project_id_table_name_column_name"), new TableField[] { DocumentDescription.DOCUMENT_DESCRIPTION.PROJECT_ID, DocumentDescription.DOCUMENT_DESCRIPTION.TABLE_NAME, DocumentDescription.DOCUMENT_DESCRIPTION.COLUMN_NAME }, true); public static final UniqueKey KEY_DOCUMENT_DISCUSSION_PRIMARY = Internal.createUniqueKey(DocumentDiscussion.DOCUMENT_DISCUSSION, DSL.name("KEY_document_discussion_PRIMARY"), new TableField[] { DocumentDiscussion.DOCUMENT_DISCUSSION.ID }, true); + public static final UniqueKey KEY_DOCUMENT_TEMPLATE_PROPERTY_PRIMARY = Internal.createUniqueKey(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY, DSL.name("KEY_document_template_property_PRIMARY"), new TableField[] { DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.ID }, true); + public static final UniqueKey KEY_DOCUMENT_TEMPLATE_PROPERTY_UK_TYPE_KEY = Internal.createUniqueKey(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY, DSL.name("KEY_document_template_property_uk_type_key"), new TableField[] { DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.TYPE, DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.KEY }, true); public static final UniqueKey KEY_GROUP_PRIMARY = Internal.createUniqueKey(Group.GROUP, DSL.name("KEY_group_PRIMARY"), new TableField[] { Group.GROUP.ID }, true); public static final UniqueKey KEY_LOGIN_PRIMARY = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_PRIMARY"), new TableField[] { Login.LOGIN.ID }, true); public static final UniqueKey KEY_LOGIN_UK_USER_ID = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_uk_user_id"), new TableField[] { Login.LOGIN.USER_ID }, true); diff --git a/dao/generated-src/jooq/main/java/com/databasir/dao/Tables.java b/dao/generated-src/jooq/main/java/com/databasir/dao/Tables.java index cd0d18b..865b0d4 100644 --- a/dao/generated-src/jooq/main/java/com/databasir/dao/Tables.java +++ b/dao/generated-src/jooq/main/java/com/databasir/dao/Tables.java @@ -10,6 +10,7 @@ import com.databasir.dao.tables.DatabaseDocument; import com.databasir.dao.tables.DatabaseType; import com.databasir.dao.tables.DocumentDescription; import com.databasir.dao.tables.DocumentDiscussion; +import com.databasir.dao.tables.DocumentTemplateProperty; import com.databasir.dao.tables.Group; import com.databasir.dao.tables.Login; import com.databasir.dao.tables.OauthApp; @@ -64,6 +65,11 @@ public class Tables { */ public static final DocumentDiscussion DOCUMENT_DISCUSSION = DocumentDiscussion.DOCUMENT_DISCUSSION; + /** + * template property + */ + public static final DocumentTemplateProperty DOCUMENT_TEMPLATE_PROPERTY = DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY; + /** * The table databasir.group. */ diff --git a/dao/generated-src/jooq/main/java/com/databasir/dao/tables/DocumentTemplateProperty.java b/dao/generated-src/jooq/main/java/com/databasir/dao/tables/DocumentTemplateProperty.java new file mode 100644 index 0000000..b4bcbe0 --- /dev/null +++ b/dao/generated-src/jooq/main/java/com/databasir/dao/tables/DocumentTemplateProperty.java @@ -0,0 +1,163 @@ +/* + * This file is generated by jOOQ. + */ +package com.databasir.dao.tables; + + +import com.databasir.dao.Databasir; +import com.databasir.dao.Keys; +import com.databasir.dao.tables.records.DocumentTemplatePropertyRecord; +import org.jooq.*; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.List; + + +/** + * template property + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class DocumentTemplateProperty extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of + * databasir.document_template_property + */ + public static final DocumentTemplateProperty DOCUMENT_TEMPLATE_PROPERTY = new DocumentTemplateProperty(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return DocumentTemplatePropertyRecord.class; + } + + /** + * The column databasir.document_template_property.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); + + /** + * The column databasir.document_template_property.key. + */ + public final TableField KEY = createField(DSL.name("key"), SQLDataType.VARCHAR(255).nullable(false), this, ""); + + /** + * The column databasir.document_template_property.value. + */ + public final TableField VALUE = createField(DSL.name("value"), SQLDataType.VARCHAR(255), this, ""); + + /** + * The column + * databasir.document_template_property.default_value. + */ + public final TableField DEFAULT_VALUE = createField(DSL.name("default_value"), SQLDataType.VARCHAR(255).nullable(false), this, ""); + + /** + * The column databasir.document_template_property.type. + */ + public final TableField TYPE = createField(DSL.name("type"), SQLDataType.VARCHAR(64).nullable(false), this, ""); + + /** + * The column databasir.document_template_property.create_at. + */ + public final TableField CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, ""); + + private DocumentTemplateProperty(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private DocumentTemplateProperty(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("template property"), TableOptions.table()); + } + + /** + * Create an aliased databasir.document_template_property table + * reference + */ + public DocumentTemplateProperty(String alias) { + this(DSL.name(alias), DOCUMENT_TEMPLATE_PROPERTY); + } + + /** + * Create an aliased databasir.document_template_property table + * reference + */ + public DocumentTemplateProperty(Name alias) { + this(alias, DOCUMENT_TEMPLATE_PROPERTY); + } + + /** + * Create a databasir.document_template_property table + * reference + */ + public DocumentTemplateProperty() { + this(DSL.name("document_template_property"), null); + } + + public DocumentTemplateProperty(Table child, ForeignKey key) { + super(child, key, DOCUMENT_TEMPLATE_PROPERTY); + } + + @Override + public Schema getSchema() { + return aliased() ? null : Databasir.DATABASIR; + } + + @Override + public Identity getIdentity() { + return (Identity) super.getIdentity(); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.KEY_DOCUMENT_TEMPLATE_PROPERTY_PRIMARY; + } + + @Override + public List> getUniqueKeys() { + return Arrays.asList(Keys.KEY_DOCUMENT_TEMPLATE_PROPERTY_UK_TYPE_KEY); + } + + @Override + public DocumentTemplateProperty as(String alias) { + return new DocumentTemplateProperty(DSL.name(alias), this); + } + + @Override + public DocumentTemplateProperty as(Name alias) { + return new DocumentTemplateProperty(alias, this); + } + + /** + * Rename this table + */ + @Override + public DocumentTemplateProperty rename(String name) { + return new DocumentTemplateProperty(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public DocumentTemplateProperty rename(Name name) { + return new DocumentTemplateProperty(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } +} diff --git a/dao/generated-src/jooq/main/java/com/databasir/dao/tables/pojos/DocumentTemplatePropertyPojo.java b/dao/generated-src/jooq/main/java/com/databasir/dao/tables/pojos/DocumentTemplatePropertyPojo.java new file mode 100644 index 0000000..7d4ecc3 --- /dev/null +++ b/dao/generated-src/jooq/main/java/com/databasir/dao/tables/pojos/DocumentTemplatePropertyPojo.java @@ -0,0 +1,153 @@ +/* + * This file is generated by jOOQ. + */ +package com.databasir.dao.tables.pojos; + + +import java.io.Serializable; +import java.time.LocalDateTime; + + +/** + * template property + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class DocumentTemplatePropertyPojo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Integer id; + private String key; + private String value; + private String defaultValue; + private String type; + private LocalDateTime createAt; + + public DocumentTemplatePropertyPojo() {} + + public DocumentTemplatePropertyPojo(DocumentTemplatePropertyPojo value) { + this.id = value.id; + this.key = value.key; + this.value = value.value; + this.defaultValue = value.defaultValue; + this.type = value.type; + this.createAt = value.createAt; + } + + public DocumentTemplatePropertyPojo( + Integer id, + String key, + String value, + String defaultValue, + String type, + LocalDateTime createAt + ) { + this.id = id; + this.key = key; + this.value = value; + this.defaultValue = defaultValue; + this.type = type; + this.createAt = createAt; + } + + /** + * Getter for databasir.document_template_property.id. + */ + public Integer getId() { + return this.id; + } + + /** + * Setter for databasir.document_template_property.id. + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * Getter for databasir.document_template_property.key. + */ + public String getKey() { + return this.key; + } + + /** + * Setter for databasir.document_template_property.key. + */ + public void setKey(String key) { + this.key = key; + } + + /** + * Getter for databasir.document_template_property.value. + */ + public String getValue() { + return this.value; + } + + /** + * Setter for databasir.document_template_property.value. + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Getter for + * databasir.document_template_property.default_value. + */ + public String getDefaultValue() { + return this.defaultValue; + } + + /** + * Setter for + * databasir.document_template_property.default_value. + */ + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + /** + * Getter for databasir.document_template_property.type. + */ + public String getType() { + return this.type; + } + + /** + * Setter for databasir.document_template_property.type. + */ + public void setType(String type) { + this.type = type; + } + + /** + * Getter for databasir.document_template_property.create_at. + */ + public LocalDateTime getCreateAt() { + return this.createAt; + } + + /** + * Setter for databasir.document_template_property.create_at. + */ + public void setCreateAt(LocalDateTime createAt) { + this.createAt = createAt; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("DocumentTemplatePropertyPojo ("); + + sb.append(id); + sb.append(", ").append(key); + sb.append(", ").append(value); + sb.append(", ").append(defaultValue); + sb.append(", ").append(type); + sb.append(", ").append(createAt); + + sb.append(")"); + return sb.toString(); + } +} diff --git a/dao/generated-src/jooq/main/java/com/databasir/dao/tables/records/DocumentTemplatePropertyRecord.java b/dao/generated-src/jooq/main/java/com/databasir/dao/tables/records/DocumentTemplatePropertyRecord.java new file mode 100644 index 0000000..06474d0 --- /dev/null +++ b/dao/generated-src/jooq/main/java/com/databasir/dao/tables/records/DocumentTemplatePropertyRecord.java @@ -0,0 +1,313 @@ +/* + * This file is generated by jOOQ. + */ +package com.databasir.dao.tables.records; + + +import com.databasir.dao.tables.DocumentTemplateProperty; +import com.databasir.dao.tables.pojos.DocumentTemplatePropertyPojo; + +import java.time.LocalDateTime; + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record6; +import org.jooq.Row6; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * template property + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class DocumentTemplatePropertyRecord extends UpdatableRecordImpl implements Record6 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for databasir.document_template_property.id. + */ + public void setId(Integer value) { + set(0, value); + } + + /** + * Getter for databasir.document_template_property.id. + */ + public Integer getId() { + return (Integer) get(0); + } + + /** + * Setter for databasir.document_template_property.key. + */ + public void setKey(String value) { + set(1, value); + } + + /** + * Getter for databasir.document_template_property.key. + */ + public String getKey() { + return (String) get(1); + } + + /** + * Setter for databasir.document_template_property.value. + */ + public void setValue(String value) { + set(2, value); + } + + /** + * Getter for databasir.document_template_property.value. + */ + public String getValue() { + return (String) get(2); + } + + /** + * Setter for + * databasir.document_template_property.default_value. + */ + public void setDefaultValue(String value) { + set(3, value); + } + + /** + * Getter for + * databasir.document_template_property.default_value. + */ + public String getDefaultValue() { + return (String) get(3); + } + + /** + * Setter for databasir.document_template_property.type. + */ + public void setType(String value) { + set(4, value); + } + + /** + * Getter for databasir.document_template_property.type. + */ + public String getType() { + return (String) get(4); + } + + /** + * Setter for databasir.document_template_property.create_at. + */ + public void setCreateAt(LocalDateTime value) { + set(5, value); + } + + /** + * Getter for databasir.document_template_property.create_at. + */ + public LocalDateTime getCreateAt() { + return (LocalDateTime) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.ID; + } + + @Override + public Field field2() { + return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.KEY; + } + + @Override + public Field field3() { + return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.VALUE; + } + + @Override + public Field field4() { + return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.DEFAULT_VALUE; + } + + @Override + public Field field5() { + return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.TYPE; + } + + @Override + public Field field6() { + return DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.CREATE_AT; + } + + @Override + public Integer component1() { + return getId(); + } + + @Override + public String component2() { + return getKey(); + } + + @Override + public String component3() { + return getValue(); + } + + @Override + public String component4() { + return getDefaultValue(); + } + + @Override + public String component5() { + return getType(); + } + + @Override + public LocalDateTime component6() { + return getCreateAt(); + } + + @Override + public Integer value1() { + return getId(); + } + + @Override + public String value2() { + return getKey(); + } + + @Override + public String value3() { + return getValue(); + } + + @Override + public String value4() { + return getDefaultValue(); + } + + @Override + public String value5() { + return getType(); + } + + @Override + public LocalDateTime value6() { + return getCreateAt(); + } + + @Override + public DocumentTemplatePropertyRecord value1(Integer value) { + setId(value); + return this; + } + + @Override + public DocumentTemplatePropertyRecord value2(String value) { + setKey(value); + return this; + } + + @Override + public DocumentTemplatePropertyRecord value3(String value) { + setValue(value); + return this; + } + + @Override + public DocumentTemplatePropertyRecord value4(String value) { + setDefaultValue(value); + return this; + } + + @Override + public DocumentTemplatePropertyRecord value5(String value) { + setType(value); + return this; + } + + @Override + public DocumentTemplatePropertyRecord value6(LocalDateTime value) { + setCreateAt(value); + return this; + } + + @Override + public DocumentTemplatePropertyRecord values(Integer value1, String value2, String value3, String value4, String value5, LocalDateTime value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached DocumentTemplatePropertyRecord + */ + public DocumentTemplatePropertyRecord() { + super(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY); + } + + /** + * Create a detached, initialised DocumentTemplatePropertyRecord + */ + public DocumentTemplatePropertyRecord(Integer id, String key, String value, String defaultValue, String type, LocalDateTime createAt) { + super(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY); + + setId(id); + setKey(key); + setValue(value); + setDefaultValue(defaultValue); + setType(type); + setCreateAt(createAt); + } + + /** + * Create a detached, initialised DocumentTemplatePropertyRecord + */ + public DocumentTemplatePropertyRecord(DocumentTemplatePropertyPojo value) { + super(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY); + + if (value != null) { + setId(value.getId()); + setKey(value.getKey()); + setValue(value.getValue()); + setDefaultValue(value.getDefaultValue()); + setType(value.getType()); + setCreateAt(value.getCreateAt()); + } + } +} diff --git a/dao/src/main/resources/db/migration/V1__init.sql b/dao/src/main/resources/db/migration/V1__init.sql index c2ae585..9bca2a7 100644 --- a/dao/src/main/resources/db/migration/V1__init.sql +++ b/dao/src/main/resources/db/migration/V1__init.sql @@ -330,4 +330,16 @@ CREATE TABLE IF NOT EXISTS document_description create_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, CONSTRAINT UNIQUE uk_project_id_table_name_column_name (project_id, table_name, column_name) ) CHARSET utf8mb4 - COLLATE utf8mb4_unicode_ci COMMENT 'custom document description'; \ No newline at end of file + COLLATE utf8mb4_unicode_ci COMMENT 'custom document description'; + +CREATE TABLE IF NOT EXISTS document_template_property +( + `id` INT PRIMARY KEY AUTO_INCREMENT, + `key` VARCHAR(255) NOT NULL, + `value` VARCHAR(255) DEFAULT NULL, + `default_value` VARCHAR(255) NOT NULL, + `type` VARCHAR(64) NOT NULL, + `create_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT UNIQUE uk_type_key (`type`, `key`) +) CHARSET utf8mb4 + COLLATE utf8mb4_unicode_ci COMMENT 'template property'; \ No newline at end of file