io.convergence_platform.common.database.blueprints.TableBlueprint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of service-lib Show documentation
Show all versions of service-lib Show documentation
Holds the common functionality needed by all Convergence Platform-based services written in Java.
The newest version!
package io.convergence_platform.common.database.blueprints;
import java.util.ArrayList;
import java.util.List;
public class TableBlueprint {
public String name;
public List columns = new ArrayList<>();
public List indices = new ArrayList<>();
public boolean checkExistence = false;
public void addOperationDates() {
addOperationDates(true, true, true);
}
public void addOperationDates(boolean createdAt, boolean updatedAt, boolean deletedAt) {
if (createdAt) {
columns.add(new TableColumnBlueprint("created_at", "timestamp", false, false, false, "CURRENT_TIMESTAMP"));
}
if (updatedAt) {
columns.add(new TableColumnBlueprint("updated_at", "timestamp", false, false, true, null));
}
if (deletedAt) {
columns.add(new TableColumnBlueprint("deleted_at", "timestamp", false, false, true, null));
}
}
}