diff --git a/calexium_lib b/calexium_lib index 94b434c..3fbc7cc 160000 --- a/calexium_lib +++ b/calexium_lib @@ -1 +1 @@ -Subproject commit 94b434c75a443c7426ce437df4224b61e3ecc1e2 +Subproject commit 3fbc7cca5e2b7e98540338ec0d9a9dbfa5762288 diff --git a/hayamiki_lib b/hayamiki_lib index d684d8d..b0e5ce0 160000 --- a/hayamiki_lib +++ b/hayamiki_lib @@ -1 +1 @@ -Subproject commit d684d8d709b015c4d396c9b24f4e882628e3b65f +Subproject commit b0e5ce0d6103b9179b98d3967fbdc994fcc76265 diff --git a/src/generation/fields.anubis b/src/generation/fields.anubis index 9d78c73..fbf6ac8 100644 --- a/src/generation/fields.anubis +++ b/src/generation/fields.anubis @@ -48,7 +48,7 @@ public define String date_field(_) then fill("DATE", 15) +format_attributes(attributes), time_field(_) then fill("TIME", 15) +format_attributes(attributes), datetime_field(_) then fill("DATETIME", 15)+format_attributes(attributes), - foreign_key(app,fk) then fill("INTEGER", 15) +" NOT NULL REFERENCES "+fk+" (id)", + foreign_key(app,fk) then fill("INTEGER", 15) +format_attributes(attributes)+" REFERENCES "+fk+"(id) ", integer_field then fill("INTEGER", 15) +format_attributes(attributes), char_field(Int size) then fill("VARCHAR("+size+")", 15) +format_attributes(attributes), text_field then fill("TEXT", 15) +format_attributes(attributes), diff --git a/src/main.anubis b/src/main.anubis index 976d9b1..99386b9 100644 --- a/src/main.anubis +++ b/src/main.anubis @@ -18,10 +18,9 @@ read tools/basis.anubis read generation/files.anubis read hayamiki_lib/hk_generator.anubis read model.3.0.0.anubis +read system/muscle.anubis - - -global define One + global define One hayamiki ( List(String) args @@ -29,6 +28,16 @@ global define One if load_hk_generator is { failure then println("Hayamiki generator can't be load"), - success(hk_gen) then forget(hk_gen.generate_model_files(the_database_description, "")) + success(hk_gen) then forget(hk_gen.generate_model_files(domain_manager_description, "")) }. + global define One + hk_save + ( + List(String) args + )= + with message = to_Message(the_database_description), + println("\n Database dump"); + println(dump(message)) + . + diff --git a/src/model.3.0.0.anubis b/src/model.3.0.0.anubis index 04ffe4b..c525ccd 100644 --- a/src/model.3.0.0.anubis +++ b/src/model.3.0.0.anubis @@ -1,59 +1,6 @@ read hayamiki_lib/types/hayamiki.anubis - -public define HK_Table mf_serial_table = - hk_table("mf_serial", - hk_model( - [ - - hk_column("serial", char_field(30), []), - hk_column("mac", char_field(30), []), - hk_column("app_id", char_field(50), []), - hk_column("enabled", boolean_field, [], help_text("Is enabled?")), - hk_column("free_domain", boolean_field, [], help_text("Free domain available?")), - hk_column("max_domains", integer_field, [], help_text("Maximum number of domains")), - hk_column("is_demo", boolean_field, [], help_text("Is demo?")), - hk_column("is_test", boolean_field, [], help_text("Is test?")), - hk_column("date_created", datetime_field(auto_now_add), []), - hk_column("last_updated", datetime_field(none), []), - hk_column("last_ping", datetime_field(none), []), - hk_column("current_ip", char_field(20), []), - hk_column("mf_version", char_field(20), [], help_text("MF version")), - hk_column("vm_version", char_field(20), [], help_text_TAG("ANUBIS_VM_VER")), - hk_column("os_version", char_field(20), [], help_text("OS version")), - hk_column("ipkg_list", text_field, []), - hk_column("ifconfig", text_field, []), - hk_column("dmesg", text_field, []), - hk_column("memory", text_field, []), - hk_column("vm_memory", text_field, []), - hk_column("status", text_field, []), - hk_column("disks", text_field, []), - hk_column("isp_smtp", text_field, []), - hk_column("description", text_field, []), - hk_column("comments", text_field, []), - hk_column("alert_received", boolean_field, [], help_text("Alert received?")), - hk_column("alert_date", datetime_field(none), []), - hk_column("alert_msg", text_field, []), - hk_column("alert_mf_version", char_field(20), []), - ], - "obj.serial" - ), - hk_display( - - [ - //list_view - list_view("default", ["serial", "mf_version", "mac", "app_id", "is_demo", "is_test", "last_updated", "last_ping", "mf_version"]), - ], - //list of edit - ( - //edit_view_all - ["serial", "mac", "app_id", "enabled", "free_domain", "max_domains", "is_demo", "is_test", "date_created", "last_updated", "last_ping", "current_ip", "mf_version", - "os_version", "ipkg_list", "ifconfig", "dmesg", "memory", "vm_memory", "status", "disks", "isp_smtp", "description", "comments", "alert_received", "alert_date", - "alert_msg", "alert_mf_version"] - ) - ) - ). public define HK_Table settings_table = hk_table("settings", @@ -700,7 +647,9 @@ public define HK_Table address_book_contact_table = ["first_name", "last_name", "company", "role", "address1", "address2", "zipcode", "city", "country", "email", "url", "phone", "fax", "mobile", "comments"] ) ). - + + + public define HK_Database the_database_description = -- libgit2 0.21.4