Change a couple columns to be not-nullable #8
diff --git a/data-catalog-api/server/core/src/main/java/org/apache/airavata/datacatalog/api/model/MetadataSchemaFieldEntity.java b/data-catalog-api/server/core/src/main/java/org/apache/airavata/datacatalog/api/model/MetadataSchemaFieldEntity.java
index 3238f80..6d44e63 100644
--- a/data-catalog-api/server/core/src/main/java/org/apache/airavata/datacatalog/api/model/MetadataSchemaFieldEntity.java
+++ b/data-catalog-api/server/core/src/main/java/org/apache/airavata/datacatalog/api/model/MetadataSchemaFieldEntity.java
@@ -36,6 +36,7 @@
     private String jsonPath;
 
     @Enumerated(EnumType.STRING)
+    @Column(nullable = false)
     private FieldValueType fieldValueType;
 
     @ManyToOne(optional = false)
diff --git a/data-catalog-api/server/service/liquibase.properties b/data-catalog-api/server/service/liquibase.properties
index 1f72d49..8bb4b30 100644
--- a/data-catalog-api/server/service/liquibase.properties
+++ b/data-catalog-api/server/service/liquibase.properties
@@ -1,8 +1,13 @@
-# url:  jdbc:postgresql://localhost:5432/data_catalog
-url: offline:postgresql?snapshot=snapshot.json
+# Run the following to create a snapshot file
+#   liquibase snapshot --output-file=snapshot.json
+# Then update the local database and run the following to create a diff with the snapshot
+#   liquibase diffChangeLog "--url=offline:postgresql?snapshot=snapshot.json" --changelog-file=mydiff.xml
+url:  jdbc:postgresql://localhost:5432/data_catalog
+# url: offline:postgresql?snapshot=snapshot.json
 username: postgres
 password: example
-# classpath:  mysql-connector-java-8.0.27.jar
 referenceUrl:  jdbc:postgresql://localhost:5432/data_catalog
 referenceUsername: postgres
 referencePassword: example
+snapshotFormat: json
+# outputFile=snapshot.json
diff --git a/data-catalog-api/server/service/src/main/resources/db/changelog/2023/09/2023-09-01-changelog.xml b/data-catalog-api/server/service/src/main/resources/db/changelog/2023/09/2023-09-01-changelog.xml
new file mode 100644
index 0000000..c785fb9
--- /dev/null
+++ b/data-catalog-api/server/service/src/main/resources/db/changelog/2023/09/2023-09-01-changelog.xml
@@ -0,0 +1,11 @@
+<?xml version="1.1" encoding="UTF-8" standalone="no"?>
+<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"/>
+<?xml version="1.1" encoding="UTF-8" standalone="no"?>
+<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
+    <changeSet author="mchristie31 (generated)" id="1693603568810-1">
+        <addNotNullConstraint columnDataType="varchar(255)" columnName="field_value_type" tableName="metadata_schema_field" validate="true"/>
+    </changeSet>
+    <changeSet author="mchristie31 (generated)" id="1693603568810-2">
+        <addNotNullConstraint columnDataType="varchar(255)" columnName="permission_id" tableName="simple_user_sharing" validate="true"/>
+    </changeSet>
+</databaseChangeLog>
diff --git a/data-catalog-api/server/service/src/main/resources/db/changelog/db.changelog-master.xml b/data-catalog-api/server/service/src/main/resources/db/changelog/db.changelog-master.xml
index 50be033..372f172 100644
--- a/data-catalog-api/server/service/src/main/resources/db/changelog/db.changelog-master.xml
+++ b/data-catalog-api/server/service/src/main/resources/db/changelog/db.changelog-master.xml
@@ -5,4 +5,5 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
     <include file="db/changelog/2023/08/2023-08-31-init-changelog.xml"/>
     <include file="db/changelog/2023/08/2023-08-31-init-custos-changelog.xml"/>
+    <include file="db/changelog/2023/09/2023-09-31-changelog.xml"/>
 </databaseChangeLog>
diff --git a/data-catalog-api/server/simple-sharing/src/main/java/org/apache/airavata/datacatalog/api/model/sharing/simple/SimpleUserSharingEntity.java b/data-catalog-api/server/simple-sharing/src/main/java/org/apache/airavata/datacatalog/api/model/sharing/simple/SimpleUserSharingEntity.java
index afb7be3..1a4f0ff 100644
--- a/data-catalog-api/server/simple-sharing/src/main/java/org/apache/airavata/datacatalog/api/model/sharing/simple/SimpleUserSharingEntity.java
+++ b/data-catalog-api/server/simple-sharing/src/main/java/org/apache/airavata/datacatalog/api/model/sharing/simple/SimpleUserSharingEntity.java
@@ -36,7 +36,7 @@
     @JoinColumn(name = "data_product_id", nullable = false, updatable = false, foreignKey = @ForeignKey(name = "fk_simple_user_sharing_data_product_id"))
     private DataProductEntity dataProduct;
 
-    @Column(name = "permission_id")
+    @Column(name = "permission_id", nullable = false)
     @Enumerated(EnumType.STRING)
     private Permission permission;