Commit 0f2bd501 by Tatang S

update cek field di initializedb

1 parent dd4839ce
...@@ -271,7 +271,11 @@ def append_csv(table, filename, keys, get_file_func=get_file, ...@@ -271,7 +271,11 @@ def append_csv(table, filename, keys, get_file_func=get_file,
# Penambahan checking field nullable false wajib ada datanya 2024-09-05 # Penambahan checking field nullable false wajib ada datanya 2024-09-05
for c in columns_table: for c in columns_table:
if (not c["nullable"] and c["name"] not in data and c["name"] != "id"): # if (not c["nullable"] and c["name"] not in data and c["name"] != "id"):
if (not c["nullable"] and c["name"] not in data and c["name"] != "id") and c["default"] is None:
# update: tambah periksa nilai default.
# Jika default=None berarti wajib ada nilainya
# by tatang 2024-10-12
raise Exception( raise Exception(
f"Table {str(table.__name__)} Field '{c['name']}' wajib ada {c['type']} ") f"Table {str(table.__name__)} Field '{c['name']}' wajib ada {c['type']} ")
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!