simple api model
This commit is contained in:
32
src/main/resources/dbmigration/1.0__initial.sql
Normal file
32
src/main/resources/dbmigration/1.0__initial.sql
Normal file
@@ -0,0 +1,32 @@
|
||||
-- apply changes
|
||||
create table data_model
|
||||
(
|
||||
id bigint generated by default as identity not null,
|
||||
tenant_id bigint not null,
|
||||
deleted_on timestamp,
|
||||
deleted_by bigint,
|
||||
deleted boolean default false not null,
|
||||
version integer not null,
|
||||
created_at timestamp not null,
|
||||
modified_at timestamp not null,
|
||||
created_by bigint not null,
|
||||
modified_by bigint not null,
|
||||
data jsonb not null,
|
||||
tags varchar[] not null,
|
||||
comments jsonb not null,
|
||||
unique_identifier varchar(255) not null,
|
||||
entity_name varchar(255) not null,
|
||||
constraint pk_data_model primary key (id)
|
||||
);
|
||||
|
||||
create unique index data_model_uniq_identifier on data_model (unique_identifier);
|
||||
create index data_json_jdx on data_model using GIN (data);
|
||||
create index data_json_meta_data on data_model (tenant_id,
|
||||
deleted,
|
||||
version,
|
||||
created_at,
|
||||
modified_at,
|
||||
created_by,
|
||||
modified_by,
|
||||
entity_name
|
||||
);
|
||||
22
src/main/resources/dbmigration/model/1.0__initial.model.xml
Normal file
22
src/main/resources/dbmigration/model/1.0__initial.model.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<migration xmlns="http://ebean-orm.github.io/xml/ns/dbmigration">
|
||||
<changeSet type="apply">
|
||||
<createTable name="data_model" pkName="pk_data_model">
|
||||
<column name="id" type="bigint" primaryKey="true"/>
|
||||
<column name="tenant_id" type="bigint" notnull="true"/>
|
||||
<column name="deleted_on" type="localdatetime"/>
|
||||
<column name="deleted_by" type="bigint"/>
|
||||
<column name="data" type="jsonb" notnull="true"/>
|
||||
<column name="tags" type="varchar[]" notnull="true"/>
|
||||
<column name="comments" type="jsonb" notnull="true"/>
|
||||
<column name="unique_identifier" type="varchar" notnull="true"/>
|
||||
<column name="entity_name" type="varchar" notnull="true"/>
|
||||
<column name="deleted" type="boolean" defaultValue="false" notnull="true"/>
|
||||
<column name="version" type="integer" notnull="true"/>
|
||||
<column name="created_at" type="localdatetime" notnull="true"/>
|
||||
<column name="modified_at" type="localdatetime" notnull="true"/>
|
||||
<column name="created_by" type="bigint" notnull="true"/>
|
||||
<column name="modified_by" type="bigint" notnull="true"/>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
</migration>
|
||||
4
src/main/resources/ebean.mf
Normal file
4
src/main/resources/ebean.mf
Normal file
@@ -0,0 +1,4 @@
|
||||
entity-packages: com.readymixerp.domain
|
||||
querybean-packages: com.readymixerp.domain
|
||||
transactional-packages: com.readymixerp
|
||||
profile-location: true
|
||||
Reference in New Issue
Block a user