From daacd63c8bca2da57794756798927ed97cc48f3f Mon Sep 17 00:00:00 2001 From: tgstation-server Date: Wed, 25 Mar 2020 04:31:57 +0000 Subject: [PATCH] Deploy code docs to GitHub Pages for Appveyor build 1080 Commit: 25e92f83bc65dcc305e18728eb23233def40b107 --- ...3___m_s_initial_create_8_designer_8cs.html | 12 +- ..._initial_create_8_designer_8cs_source.html | 15 +- 20180906135553___m_s_initial_create_8cs.html | 12 +- ...35553___m_s_initial_create_8cs_source.html | 14 +- ...9___m_y_initial_create_8_designer_8cs.html | 12 +- ..._initial_create_8_designer_8cs_source.html | 15 +- 20180906143029___m_y_initial_create_8cs.html | 12 +- ...43029___m_y_initial_create_8cs_source.html | 14 +- ...y_add_minimum_security_8_designer_8cs.html | 12 +- ...inimum_security_8_designer_8cs_source.html | 15 +- ...020726___m_y_add_minimum_security_8cs.html | 12 +- ...__m_y_add_minimum_security_8cs_source.html | 14 +- ...s_add_minimum_security_8_designer_8cs.html | 12 +- ...inimum_security_8_designer_8cs_source.html | 13 +- ...021228___m_s_add_minimum_security_8cs.html | 12 +- ...__m_s_add_minimum_security_8cs_source.html | 14 +- ...nd_foreign_key_cleanup_8_designer_8cs.html | 12 +- ...ign_key_cleanup_8_designer_8cs_source.html | 15 +- ..._nullable_and_foreign_key_cleanup_8cs.html | 12 +- ...le_and_foreign_key_cleanup_8cs_source.html | 14 +- ...nd_foreign_key_cleanup_8_designer_8cs.html | 12 +- ...ign_key_cleanup_8_designer_8cs_source.html | 15 +- ..._nullable_and_foreign_key_cleanup_8cs.html | 12 +- ...le_and_foreign_key_cleanup_8cs_source.html | 12 +- ...h_compile_job_required_8_designer_8cs.html | 12 +- ...le_job_required_8_designer_8cs_source.html | 15 +- ...m_s_reattach_compile_job_required_8cs.html | 12 +- ...ttach_compile_job_required_8cs_source.html | 14 +- ...h_compile_job_required_8_designer_8cs.html | 12 +- ...le_job_required_8_designer_8cs_source.html | 15 +- ...m_y_reattach_compile_job_required_8cs.html | 12 +- ...ttach_compile_job_required_8cs_source.html | 14 +- ...gle_testmerge_comments_8_designer_8cs.html | 12 +- ...tmerge_comments_8_designer_8cs_source.html | 13 +- ...4___m_s_toggle_testmerge_comments_8cs.html | 12 +- ..._toggle_testmerge_comments_8cs_source.html | 14 +- ...gle_testmerge_comments_8_designer_8cs.html | 12 +- ...tmerge_comments_8_designer_8cs_source.html | 15 +- ...9___m_y_toggle_testmerge_comments_8cs.html | 12 +- ..._toggle_testmerge_comments_8cs_source.html | 12 +- ...m_s_fix_rev_info_index_8_designer_8cs.html | 12 +- ..._rev_info_index_8_designer_8cs_source.html | 15 +- ...19041825___m_s_fix_rev_info_index_8cs.html | 12 +- ...5___m_s_fix_rev_info_index_8cs_source.html | 12 +- ...m_y_fix_rev_info_index_8_designer_8cs.html | 12 +- ..._rev_info_index_8_designer_8cs_source.html | 15 +- ...19042440___m_y_fix_rev_info_index_8cs.html | 12 +- ...0___m_y_fix_rev_info_index_8cs_source.html | 12 +- ...10825___s_l_add_sqlite_8_designer_8cs.html | 107 +++ ..._s_l_add_sqlite_8_designer_8cs_source.html | 86 +++ 20200322210825___s_l_add_sqlite_8cs.html | 107 +++ ...322210825___s_l_add_sqlite_8cs_source.html | 98 +++ _administration_controller_8cs_source.html | 2 +- _api_controller_8cs_source.html | 2 +- _application_8cs_source.html | 12 +- ...entication_context_factory_8cs_source.html | 2 +- _basic_watchdog_8cs_source.html | 2 +- _byond_controller_8cs_source.html | 2 +- _chat_controller_8cs_source.html | 2 +- _claims_injector_8cs_source.html | 2 +- _command_factory_8cs_source.html | 2 +- ...atchdog_2_watchdog_factory_8cs_source.html | 2 +- _configuration_controller_8cs_source.html | 2 +- _database_connection_factory_8cs_source.html | 8 +- _database_context_8cs_source.html | 20 +- _database_context_factory_8cs_source.html | 2 +- _database_seeder_8cs_source.html | 2 +- _database_type_8cs.html | 3 +- _database_type_8cs_source.html | 3 +- _dmb_factory_8cs_source.html | 2 +- _dream_daemon_controller_8cs_source.html | 2 +- _dream_maker_controller_8cs_source.html | 2 +- _experimental_watchdog_8cs_source.html | 2 +- _home_controller_8cs_source.html | 2 +- ...atabase_connection_factory_8cs_source.html | 2 +- _i_database_context_8cs_source.html | 2 +- _i_database_context_factory_8cs_source.html | 2 +- _i_database_seeder_8cs_source.html | 2 +- _i_instance_8cs_source.html | 2 +- _i_job_manager_8cs_source.html | 2 +- _instance_controller_8cs_source.html | 2 +- _instance_factory_8cs_source.html | 2 +- _instance_manager_8cs_source.html | 2 +- _instance_user_controller_8cs_source.html | 2 +- _integration_test_8cs_source.html | 9 +- _job_controller_8cs_source.html | 2 +- _job_manager_8cs_source.html | 2 +- _my_sql_database_context_8cs_source.html | 11 +- ...l_database_context_model_snapshot_8cs.html | 10 +- ...ase_context_model_snapshot_8cs_source.html | 12 +- ...gn_time_db_context_factory_8cs_source.html | 2 +- _pull_requests_command_8cs_source.html | 2 +- _reattach_info_handler_8cs_source.html | 2 +- _release_notes_8_assembly_info_8cs.html | 4 +- ...ease_notes_8_assembly_info_8cs_source.html | 6 +- _repository_controller_8cs_source.html | 2 +- _setup_wizard_8cs_source.html | 51 +- _sql_server_database_context_8cs_source.html | 12 +- ...r_database_context_model_snapshot_8cs.html | 10 +- ...ase_context_model_snapshot_8cs_source.html | 12 +- ...gn_time_db_context_factory_8cs_source.html | 2 +- _sqlite_database_context_8cs.html | 105 +++ _sqlite_database_context_8cs_source.html | 97 +++ ...e_database_context_model_snapshot_8cs.html | 104 +++ ...ase_context_model_snapshot_8cs_source.html | 92 +++ ...te_design_time_db_context_factory_8cs.html | 106 +++ ...gn_time_db_context_factory_8cs_source.html | 96 +++ ...atabase_connection_factory_8cs_source.html | 2 +- _test_experimental_watchdog_8cs_source.html | 2 +- _test_setup_wizard_8cs_source.html | 4 +- _testing_server_8cs_source.html | 22 +- ...on_8_server_8_api_8_assembly_info_8cs.html | 4 +- ...rver_8_api_8_assembly_info_8cs_source.html | 6 +- ...ver_8_api_8_tests_8_assembly_info_8cs.html | 4 +- ...pi_8_tests_8_assembly_info_8cs_source.html | 6 +- ..._8_server_8_api_8_tests_8_program_8cs.html | 4 +- ...er_8_api_8_tests_8_program_8cs_source.html | 4 +- ...8_server_8_client_8_assembly_info_8cs.html | 4 +- ...r_8_client_8_assembly_info_8cs_source.html | 6 +- ..._8_client_8_tests_8_assembly_info_8cs.html | 4 +- ...nt_8_tests_8_assembly_info_8cs_source.html | 6 +- ...server_8_client_8_tests_8_program_8cs.html | 4 +- ...8_client_8_tests_8_program_8cs_source.html | 4 +- ...st_2_components_2_instance_8cs_source.html | 2 +- ...n_8_server_8_host_8_assembly_info_8cs.html | 4 +- ...ver_8_host_8_assembly_info_8cs_source.html | 6 +- ..._8_host_8_console_8_assembly_info_8cs.html | 4 +- ..._8_console_8_assembly_info_8cs_source.html | 6 +- ...8_console_8_tests_8_assembly_info_8cs.html | 4 +- ...le_8_tests_8_assembly_info_8cs_source.html | 6 +- ..._host_8_console_8_tests_8_program_8cs.html | 4 +- ..._console_8_tests_8_program_8cs_source.html | 4 +- ...rver_8_host_8_razor_assembly_info_8cs.html | 4 +- ...host_8_razor_assembly_info_8cs_source.html | 4 +- ..._8_host_8_service_8_assembly_info_8cs.html | 4 +- ..._8_service_8_assembly_info_8cs_source.html | 6 +- ...8_service_8_tests_8_assembly_info_8cs.html | 4 +- ...ce_8_tests_8_assembly_info_8cs_source.html | 6 +- ...er_8_host_8_tests_8_assembly_info_8cs.html | 4 +- ...st_8_tests_8_assembly_info_8cs_source.html | 6 +- ...8_server_8_host_8_tests_8_program_8cs.html | 4 +- ...r_8_host_8_tests_8_program_8cs_source.html | 4 +- ...8_host_8_watchdog_8_assembly_info_8cs.html | 4 +- ...8_watchdog_8_assembly_info_8cs_source.html | 6 +- ..._watchdog_8_tests_8_assembly_info_8cs.html | 4 +- ...og_8_tests_8_assembly_info_8cs_source.html | 6 +- ...host_8_watchdog_8_tests_8_program_8cs.html | 4 +- ...watchdog_8_tests_8_program_8cs_source.html | 4 +- ..._8_server_8_tests_8_assembly_info_8cs.html | 4 +- ...er_8_tests_8_assembly_info_8cs_source.html | 6 +- ...tation_8_server_8_tests_8_program_8cs.html | 4 +- ...8_server_8_tests_8_program_8cs_source.html | 4 +- _user_controller_8cs_source.html | 2 +- _users_test_8cs.html | 102 +++ _users_test_8cs_source.html | 96 +++ _watchdog_base_8cs_source.html | 2 +- _windows_watchdog_8cs_source.html | 2 +- _windows_watchdog_factory_8cs_source.html | 2 +- annotated.html | 226 +++--- architecture.html | 2 +- class_auto_generated_program.html | 12 +- class_i_design_time_db_context_factory.html | 3 +- class_i_design_time_db_context_factory.png | Bin 1769 -> 2136 bytes class_migration.html | 27 +- class_migration.png | Bin 11783 -> 13068 bytes class_model_snapshot.html | 7 +- class_model_snapshot.png | Bin 1635 -> 2066 bytes ...on_1_1_server_1_1_api_1_1_api_headers.html | 2 +- ...1_server_1_1_api_1_1_models_1_1_token.html | 4 +- ..._1_server_1_1_api_1_1_models_1_1_user.html | 4 +- ...ation_1_1_control_panel_configuration.html | 2 +- ...figuration_1_1_database_configuration.html | 12 +- ...ration_1_1_file_logging_configuration.html | 2 +- ...nfiguration_1_1_general_configuration.html | 4 +- ...ver_1_1_host_1_1_core_1_1_application.html | 22 +- ...ost_1_1_core_1_1_setup_wizard-members.html | 13 +- ...er_1_1_host_1_1_core_1_1_setup_wizard.html | 371 ++++++--- ...abase_1_1_database_connection_factory.html | 6 +- ...database_1_1_database_context-members.html | 32 +- ...ost_1_1_database_1_1_database_context.html | 120 +-- ...esign_time_db_context_factory_helpers.html | 2 +- ...my_sql_design_time_db_context_factory.html | 2 +- ...server_design_time_db_context_factory.html | 2 +- ...esign_time_db_context_factory-members.html | 8 +- ...sqlite_design_time_db_context_factory.html | 135 ++++ ..._sqlite_design_time_db_context_factory.png | Bin 0 -> 1431 bytes ..._1_1_m_s_add_minimum_security-members.html | 12 +- ...grations_1_1_m_s_add_minimum_security.html | 228 ++++++ ...igrations_1_1_m_s_add_minimum_security.png | Bin 0 -> 1080 bytes ...ns_1_1_m_s_fix_rev_info_index-members.html | 12 +- ...migrations_1_1_m_s_fix_rev_info_index.html | 227 ++++++ ..._migrations_1_1_m_s_fix_rev_info_index.png | Bin 0 -> 1032 bytes ...ations_1_1_m_s_initial_create-members.html | 12 +- ...1_1_migrations_1_1_m_s_initial_create.html | 62 +- ..._1_1_migrations_1_1_m_s_initial_create.png | Bin 0 -> 1000 bytes ...lable_and_foreign_key_cleanup-members.html | 12 +- ..._m_s_nullable_and_foreign_key_cleanup.html | 62 +- ...1_m_s_nullable_and_foreign_key_cleanup.png | Bin 0 -> 1155 bytes ...reattach_compile_job_required-members.html | 12 +- ...1_1_m_s_reattach_compile_job_required.html | 227 ++++++ ..._1_1_m_s_reattach_compile_job_required.png | Bin 0 -> 1121 bytes ...m_s_toggle_testmerge_comments-members.html | 12 +- ...ons_1_1_m_s_toggle_testmerge_comments.html | 227 ++++++ ...ions_1_1_m_s_toggle_testmerge_comments.png | Bin 0 -> 1122 bytes ..._1_1_m_y_add_minimum_security-members.html | 88 +++ ...grations_1_1_m_y_add_minimum_security.html | 228 ++++++ ...igrations_1_1_m_y_add_minimum_security.png | Bin 0 -> 1079 bytes ...ns_1_1_m_y_fix_rev_info_index-members.html | 12 +- ...migrations_1_1_m_y_fix_rev_info_index.html | 227 ++++++ ..._migrations_1_1_m_y_fix_rev_info_index.png | Bin 0 -> 1025 bytes ...ations_1_1_m_y_initial_create-members.html | 88 +++ ...1_1_migrations_1_1_m_y_initial_create.html | 62 +- ..._1_1_migrations_1_1_m_y_initial_create.png | Bin 0 -> 1001 bytes ...lable_and_foreign_key_cleanup-members.html | 12 +- ..._m_y_nullable_and_foreign_key_cleanup.html | 62 +- ...1_m_y_nullable_and_foreign_key_cleanup.png | Bin 0 -> 1148 bytes ...reattach_compile_job_required-members.html | 12 +- ...1_1_m_y_reattach_compile_job_required.html | 227 ++++++ ..._1_1_m_y_reattach_compile_job_required.png | Bin 0 -> 1120 bytes ...m_y_toggle_testmerge_comments-members.html | 12 +- ...ons_1_1_m_y_toggle_testmerge_comments.html | 227 ++++++ ...ions_1_1_m_y_toggle_testmerge_comments.png | Bin 0 -> 1123 bytes ...tabase_context_model_snapshot-members.html | 8 +- ...y_sql_database_context_model_snapshot.html | 28 +- ...my_sql_database_context_model_snapshot.png | Bin 0 -> 1192 bytes ...migrations_1_1_s_l_add_sqlite-members.html | 12 +- ...ase_1_1_migrations_1_1_s_l_add_sqlite.html | 226 ++++++ ...base_1_1_migrations_1_1_s_l_add_sqlite.png | Bin 0 -> 980 bytes ...tabase_context_model_snapshot-members.html | 86 +++ ...erver_database_context_model_snapshot.html | 28 +- ...server_database_context_model_snapshot.png | Bin 0 -> 1187 bytes ...e_1_1_my_sql_database_context-members.html | 36 +- ..._database_1_1_my_sql_database_context.html | 40 +- ...1_sql_server_database_context-members.html | 36 +- ...abase_1_1_sql_server_database_context.html | 40 +- ...e_1_1_sqlite_database_context-members.html | 110 +++ ..._database_1_1_sqlite_database_context.html | 328 ++++++++ ...1_database_1_1_sqlite_database_context.png | Bin 0 -> 1305 bytes ...tabase_context_model_snapshot-members.html | 86 +++ ...qlite_database_context_model_snapshot.html | 135 ++++ ...sqlite_database_context_model_snapshot.png | Bin 0 -> 1153 bytes ...grations_1_1_m_s_add_minimum_security.html | 228 ------ ...igrations_1_1_m_s_add_minimum_security.png | Bin 1054 -> 0 bytes ...migrations_1_1_m_s_fix_rev_info_index.html | 227 ------ ..._migrations_1_1_m_s_fix_rev_info_index.png | Bin 1006 -> 0 bytes ..._1_1_migrations_1_1_m_s_initial_create.png | Bin 979 -> 0 bytes ...1_m_s_nullable_and_foreign_key_cleanup.png | Bin 1140 -> 0 bytes ...1_1_m_s_reattach_compile_job_required.html | 227 ------ ..._1_1_m_s_reattach_compile_job_required.png | Bin 1104 -> 0 bytes ...ons_1_1_m_s_toggle_testmerge_comments.html | 227 ------ ...ions_1_1_m_s_toggle_testmerge_comments.png | Bin 1107 -> 0 bytes ...grations_1_1_m_y_add_minimum_security.html | 228 ------ ...igrations_1_1_m_y_add_minimum_security.png | Bin 1056 -> 0 bytes ...ns_1_1_m_y_fix_rev_info_index-members.html | 88 --- ...migrations_1_1_m_y_fix_rev_info_index.html | 227 ------ ..._migrations_1_1_m_y_fix_rev_info_index.png | Bin 1003 -> 0 bytes ..._1_1_migrations_1_1_m_y_initial_create.png | Bin 975 -> 0 bytes ...1_m_y_nullable_and_foreign_key_cleanup.png | Bin 1133 -> 0 bytes ...1_1_m_y_reattach_compile_job_required.html | 227 ------ ..._1_1_m_y_reattach_compile_job_required.png | Bin 1105 -> 0 bytes ...ons_1_1_m_y_toggle_testmerge_comments.html | 227 ------ ...ions_1_1_m_y_toggle_testmerge_comments.png | Bin 1105 -> 0 bytes ...my_sql_database_context_model_snapshot.png | Bin 1194 -> 0 bytes ...server_database_context_model_snapshot.png | Bin 1197 -> 0 bytes ..._1_server_1_1_host_1_1_server_factory.html | 2 +- ...ver_1_1_tests_1_1_administration_test.html | 2 +- ...r_1_1_tests_1_1_instance_manager_test.html | 2 +- ...server_1_1_tests_1_1_integration_test.html | 11 +- ...1_server_1_1_tests_1_1_testing_server.html | 60 +- ...rver_1_1_tests_1_1_users_test-members.html | 89 +++ ...n_1_1_server_1_1_tests_1_1_users_test.html | 211 +++++ classes.html | 193 ++--- ... dir_009a3598be1715e27911e1588bdd551c.html | 4 +- ... dir_019c6d3af924151b681494cc466be1ac.html | 8 +- ... dir_0b6a380fe7fc1e1d640d1ac854fc3fb6.html | 8 +- dir_103b33cf1ab7043de6f87dfa61afa23f.html | 2 +- ... dir_1083fcf52a7d94a2efffb6ca88246acf.html | 4 +- dir_177c182c6d1f29bec543c3fdad3072d5.html | 2 +- ... dir_18f2820c1d411453d7d989b812e41820.html | 4 +- ... dir_2553b13cbb871373b0c30fb90d66217c.html | 4 +- ... dir_26764abc66ddba24c5915db53fd68d23.html | 8 +- ... dir_2b9d136d9ffdab429a63a74fca28b300.html | 8 +- ... dir_2e39d68cad3f83629c74ea67329dead9.html | 8 +- ... dir_2e67631cb23401d696bcfdbe81f86f0f.html | 8 +- dir_3a3ab2f663730d5bed7026cf41734e8a.html | 4 + dir_446bdfc1cd19b69c11765b5665ebfd45.html | 2 +- ... dir_48968f849f7ddb061f7130e079fe66a6.html | 8 +- ... dir_4c0c7e2f4fc60f51e2347a2d8dda94ce.html | 4 +- dir_685b5aa2d8a661ab5bc3f68b331887b0.html | 2 +- dir_689f0584ee97ae9ca308532531d9c5d2.html | 2 +- ... dir_6a8d19239e99965ecc1391ebd049009a.html | 10 +- dir_74017a19412e2f90cc6ad11fcac82495.html | 2 +- ... dir_78e87f8f095a8e3bb6ef1faef94cdb78.html | 8 +- ... dir_87039fa7b841d848ca75981d64237477.html | 8 +- dir_87a4f2035ed18e30422f4b60aebc4381.html | 2 +- ... dir_9257d56e926145e494a5aa5279887044.html | 4 +- ... dir_9aa5991638c9344778d807333cc0bd50.html | 6 +- ... dir_a3714ab037275c284988fc90b4d045a5.html | 4 +- ... dir_a3831f1c39821b3669f8a3808652203f.html | 4 +- dir_a51095d0142a80f0e979ff5bf5b861be.html | 2 +- ... dir_a8807eef6592489c6a360d587f5b1a66.html | 4 +- dir_af336dd70489e812a924e1a8fba73854.html | 2 + dir_b524b00ec2259c3c83b44909fd47f6e3.html | 2 +- ... dir_b551a02288ef39e099594710382363a0.html | 4 +- ... dir_b87cbb2c60cf682b61fbfcceb9bced43.html | 4 +- ... dir_b92573f47b933d7a3661c26d1af2098b.html | 8 +- ... dir_be9f3ed3485a880e3213506a311823d1.html | 8 +- dir_bf23e1e49f40264f2966f02ed35d8142.html | 2 +- dir_c2c4d4ee47e55233c6ea5db8b96422c6.html | 5 - dir_c50f9bd139317d744e2ee08ea9a734cc.html | 2 +- ... dir_c5f98c05147bcbba78e71856485f5049.html | 4 +- ... dir_d8a279f7113e0073f6cd65dd050c1475.html | 4 +- dir_e0c1bccb03249d93bc42ac0968ce43fd.html | 2 +- ... dir_e97d380c3eebaf0856a4ec180d749620.html | 8 +- ... dir_ea36b5ab01ad6e8b607438a02ae91964.html | 8 +- dir_eb7c70823ae63176c38851687b13349d.html | 2 + dir_f0581cdd528a911f791df57d0f438bcb.html | 2 +- ... dir_f88948f9bde0555374e8a59a663bdfc9.html | 4 +- ... dir_fab1362e86740a2c573ef875dd474a67.html | 8 +- dir_fb12273b841438c2f2c9b5bc5398c636.html | 2 +- files.html | 174 +++-- functions_b.html | 30 +- functions_c.html | 8 +- functions_d.html | 29 +- functions_func_b.html | 30 +- functions_func_c.html | 7 +- functions_func_d.html | 25 +- functions_func_i.html | 5 +- functions_func_o.html | 1 + functions_func_p.html | 3 + functions_func_r.html | 1 + functions_func_s.html | 3 + functions_func_t.html | 8 +- functions_func_u.html | 35 +- functions_func_v.html | 3 + functions_i.html | 5 +- functions_o.html | 1 + functions_p.html | 3 + functions_prop_d.html | 1 + functions_r.html | 1 + functions_s.html | 3 + functions_t.html | 10 +- functions_u.html | 35 +- functions_v.html | 3 + functions_vars_c.html | 1 + functions_vars_d.html | 5 + hierarchy.html | 720 +++++++++--------- ...server_1_1_client_1_1_i_server_client.html | 10 +- ..._1_client_1_1_i_server_client_factory.html | 2 +- ..._server_1_1_client_1_1_i_users_client.html | 2 + ...r_1_1_host_1_1_core_1_1_i_application.html | 2 +- ...1_1_host_1_1_core_1_1_i_async_delayer.html | 2 +- ..._1_host_1_1_core_1_1_i_server_control.html | 4 +- ...ase_1_1_i_database_connection_factory.html | 2 +- ...t_1_1_database_1_1_i_database_context.html | 2 +- ...st_1_1_database_1_1_i_database_seeder.html | 4 +- ...server_1_1_host_1_1_i_o_1_1_i_console.html | 10 +- ...er_1_1_host_1_1_i_o_1_1_i_i_o_manager.html | 20 +- ...tion_1_1_server_1_1_host_1_1_i_server.html | 2 +- ..._server_1_1_host_1_1_i_server_factory.html | 2 +- ..._1_1_system_1_1_i_platform_identifier.html | 2 +- namespace_tgstation_1_1_server_1_1_host.html | 2 + ...1_1_server_1_1_host_1_1_configuration.html | 8 +- ...tion_1_1_server_1_1_host_1_1_database.html | 5 + ...rver_1_1_host_1_1_database_1_1_design.html | 2 + ..._1_1_host_1_1_database_1_1_migrations.html | 61 +- ...on_1_1_server_1_1_host_1_1_migrations.html | 90 +++ ...tation_1_1_server_1_1_host_1_1_models.html | 6 - namespace_tgstation_1_1_server_1_1_tests.html | 2 + namespaces.html | 41 +- search/all_0.js | 4 +- search/all_10.js | 11 +- search/all_12.js | 16 +- search/all_13.js | 10 +- search/all_14.js | 10 +- search/all_15.js | 7 +- search/all_16.js | 1 + search/all_17.js | 4 +- search/all_2.js | 4 +- search/all_3.js | 10 +- search/all_4.js | 7 +- search/all_9.js | 8 +- search/all_a.js | 2 +- search/all_c.js | 2 +- search/all_d.js | 26 +- search/all_e.js | 2 +- search/all_f.js | 2 +- search/classes_10.js | 6 +- search/classes_11.js | 6 +- search/classes_12.js | 2 +- search/classes_13.js | 3 +- search/classes_15.js | 2 +- search/classes_2.js | 6 +- search/classes_3.js | 3 +- search/classes_8.js | 4 +- search/classes_9.js | 2 +- search/classes_c.js | 26 +- search/classes_f.js | 2 +- search/enumvalues_d.js | 1 + search/files_0.js | 4 +- search/files_12.js | 3 + search/files_14.js | 1 + search/functions_1.js | 4 +- search/functions_10.js | 2 +- search/functions_11.js | 1 + search/functions_12.js | 2 + search/functions_13.js | 4 +- search/functions_14.js | 1 + search/functions_2.js | 2 +- search/functions_3.js | 2 +- search/functions_8.js | 2 +- search/functions_e.js | 2 +- search/functions_f.js | 1 + search/namespaces_1.js | 2 +- search/properties_3.js | 2 +- search/variables_2.js | 2 +- search/variables_3.js | 1 + search/variables_8.js | 2 +- search/variables_f.js | 2 +- 419 files changed, 7159 insertions(+), 4084 deletions(-) create mode 100644 20200322210825___s_l_add_sqlite_8_designer_8cs.html create mode 100644 20200322210825___s_l_add_sqlite_8_designer_8cs_source.html create mode 100644 20200322210825___s_l_add_sqlite_8cs.html create mode 100644 20200322210825___s_l_add_sqlite_8cs_source.html create mode 100644 _sqlite_database_context_8cs.html create mode 100644 _sqlite_database_context_8cs_source.html create mode 100644 _sqlite_database_context_model_snapshot_8cs.html create mode 100644 _sqlite_database_context_model_snapshot_8cs_source.html create mode 100644 _sqlite_design_time_db_context_factory_8cs.html create mode 100644 _sqlite_design_time_db_context_factory_8cs_source.html create mode 100644 _users_test_8cs.html create mode 100644 _users_test_8cs_source.html rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_my_sql_database_context_model_snapshot-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_design_1_1_sqlite_design_time_db_context_factory-members.html (73%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_design_1_1_sqlite_design_time_db_context_factory.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_design_1_1_sqlite_design_time_db_context_factory.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_fix_rev_info_index-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_add_minimum_security-members.html (63%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_add_minimum_security.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_add_minimum_security.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_add_minimum_security-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_fix_rev_info_index-members.html (67%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_fix_rev_info_index.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_fix_rev_info_index.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_initial_create-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_initial_create-members.html (65%) rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_initial_create.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_initial_create.html (71%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_initial_create.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_nullable_and_foreign_key_cleanup-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_nullable_and_foreign_key_cleanup-members.html (63%) rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_nullable_and_foreign_key_cleanup.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_nullable_and_foreign_key_cleanup.html (55%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_nullable_and_foreign_key_cleanup.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_reattach_compile_job_required-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_reattach_compile_job_required-members.html (64%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_reattach_compile_job_required.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_reattach_compile_job_required.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_toggle_testmerge_comments-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_toggle_testmerge_comments-members.html (64%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_toggle_testmerge_comments.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_s_toggle_testmerge_comments.png create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_add_minimum_security-members.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_add_minimum_security.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_add_minimum_security.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_add_minimum_security-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_fix_rev_info_index-members.html (67%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_fix_rev_info_index.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_fix_rev_info_index.png create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_initial_create-members.html rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_initial_create.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_initial_create.html (71%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_initial_create.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_nullable_and_foreign_key_cleanup-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_nullable_and_foreign_key_cleanup-members.html (63%) rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_nullable_and_foreign_key_cleanup.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_nullable_and_foreign_key_cleanup.html (54%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_nullable_and_foreign_key_cleanup.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_reattach_compile_job_required-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_reattach_compile_job_required-members.html (64%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_reattach_compile_job_required.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_reattach_compile_job_required.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_toggle_testmerge_comments-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_toggle_testmerge_comments-members.html (64%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_toggle_testmerge_comments.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_m_y_toggle_testmerge_comments.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_sql_server_database_context_model_snapshot-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_my_sql_database_context_model_snapshot-members.html (73%) rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_my_sql_database_context_model_snapshot.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_my_sql_database_context_model_snapshot.html (97%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_my_sql_database_context_model_snapshot.png rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_initial_create-members.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_s_l_add_sqlite-members.html (65%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_s_l_add_sqlite.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_s_l_add_sqlite.png create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_sql_server_database_context_model_snapshot-members.html rename class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_sql_server_database_context_model_snapshot.html => class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_sql_server_database_context_model_snapshot.html (98%) create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations_1_1_sql_server_database_context_model_snapshot.png create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_sqlite_database_context-members.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_sqlite_database_context.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_database_1_1_sqlite_database_context.png create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_migrations_1_1_sqlite_database_context_model_snapshot-members.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_migrations_1_1_sqlite_database_context_model_snapshot.html create mode 100644 class_tgstation_1_1_server_1_1_host_1_1_migrations_1_1_sqlite_database_context_model_snapshot.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_add_minimum_security.html delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_add_minimum_security.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_fix_rev_info_index.html delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_fix_rev_info_index.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_initial_create.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_nullable_and_foreign_key_cleanup.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_reattach_compile_job_required.html delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_reattach_compile_job_required.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_toggle_testmerge_comments.html delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_s_toggle_testmerge_comments.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_add_minimum_security.html delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_add_minimum_security.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_fix_rev_info_index-members.html delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_fix_rev_info_index.html delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_fix_rev_info_index.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_initial_create.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_nullable_and_foreign_key_cleanup.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_reattach_compile_job_required.html delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_reattach_compile_job_required.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_toggle_testmerge_comments.html delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_m_y_toggle_testmerge_comments.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_my_sql_database_context_model_snapshot.png delete mode 100644 class_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations_1_1_sql_server_database_context_model_snapshot.png create mode 100644 class_tgstation_1_1_server_1_1_tests_1_1_users_test-members.html create mode 100644 class_tgstation_1_1_server_1_1_tests_1_1_users_test.html rename dir_4e036e007444785d010e90b5c9a24acd.html => dir_009a3598be1715e27911e1588bdd551c.html (93%) rename dir_91e2bbee1291fcb0db7e0417b617d01e.html => dir_019c6d3af924151b681494cc466be1ac.html (91%) rename dir_53c056aa6a96f034cca75f793964be6e.html => dir_0b6a380fe7fc1e1d640d1ac854fc3fb6.html (90%) rename dir_b2c89c850c962495793d09ea3a2ee385.html => dir_1083fcf52a7d94a2efffb6ca88246acf.html (94%) rename dir_3d40f65451d27d8a0fb149ee9a9b554e.html => dir_18f2820c1d411453d7d989b812e41820.html (90%) rename dir_53aae571c66a052729f8e64ccc397130.html => dir_2553b13cbb871373b0c30fb90d66217c.html (93%) rename dir_2b188058b5c65ed53019acbdf1ae90eb.html => dir_26764abc66ddba24c5915db53fd68d23.html (90%) rename dir_90400719279795a0c5ea912516a4c874.html => dir_2b9d136d9ffdab429a63a74fca28b300.html (90%) rename dir_ec133cefc1442f53ec97e0d7a57cf129.html => dir_2e39d68cad3f83629c74ea67329dead9.html (90%) rename dir_7ae0efc0613c36c848fa310214e0aee3.html => dir_2e67631cb23401d696bcfdbe81f86f0f.html (90%) rename dir_4122b363a9d577bed19bef337e757ff3.html => dir_48968f849f7ddb061f7130e079fe66a6.html (90%) rename dir_d45f494620bc0048ee4a31fa4f7391e1.html => dir_4c0c7e2f4fc60f51e2347a2d8dda94ce.html (93%) rename dir_0c9add60ab05c04ed8367ecaedf67c01.html => dir_6a8d19239e99965ecc1391ebd049009a.html (90%) rename dir_b8a3bd11729740ba378245d2667dd433.html => dir_78e87f8f095a8e3bb6ef1faef94cdb78.html (91%) rename dir_0e792d76844bf2d7c79795a56a50ebec.html => dir_87039fa7b841d848ca75981d64237477.html (90%) rename dir_6db5af7fcfa17a34c7abf23e195af4db.html => dir_9257d56e926145e494a5aa5279887044.html (93%) rename dir_69bd2cc774829698c297e262fcc70ea6.html => dir_9aa5991638c9344778d807333cc0bd50.html (89%) rename dir_13bee0ed20ecc83b9bcd4b869b726d42.html => dir_a3714ab037275c284988fc90b4d045a5.html (93%) rename dir_0772f58f5c1b374fac16f9b51948477a.html => dir_a3831f1c39821b3669f8a3808652203f.html (94%) rename dir_fcc41a8faa41492aba200a49fc7d0aed.html => dir_a8807eef6592489c6a360d587f5b1a66.html (92%) rename dir_900257602d294c4a4799e88420919068.html => dir_b551a02288ef39e099594710382363a0.html (94%) rename dir_e928c7e494884ad322b5f6005c2954e1.html => dir_b87cbb2c60cf682b61fbfcceb9bced43.html (93%) rename dir_40138fd4849573e743490d583f6d06d6.html => dir_b92573f47b933d7a3661c26d1af2098b.html (91%) rename dir_18a5e30c14613227f95d12bd9fddc614.html => dir_be9f3ed3485a880e3213506a311823d1.html (90%) rename dir_298f2a364723f4f4cea115538f944a94.html => dir_c5f98c05147bcbba78e71856485f5049.html (94%) rename dir_83a6f600c846cd444f33e44bb9b4f9cb.html => dir_d8a279f7113e0073f6cd65dd050c1475.html (92%) rename dir_c65d377d3c73fb4a07b3637f9c0caf4d.html => dir_e97d380c3eebaf0856a4ec180d749620.html (91%) rename dir_6c8d8f20501e8e412458f542d0998195.html => dir_ea36b5ab01ad6e8b607438a02ae91964.html (91%) rename dir_383ca23c40357ede4cca827b4a365c76.html => dir_f88948f9bde0555374e8a59a663bdfc9.html (92%) rename dir_7a9d035dcfcd6d9c7aa1efef4b6b58a4.html => dir_fab1362e86740a2c573ef875dd474a67.html (90%) rename namespace_tgstation_1_1_server_1_1_host_1_1_models_1_1_migrations.html => namespace_tgstation_1_1_server_1_1_host_1_1_database_1_1_migrations.html (60%) create mode 100644 namespace_tgstation_1_1_server_1_1_host_1_1_migrations.html diff --git a/20180906135553___m_s_initial_create_8_designer_8cs.html b/20180906135553___m_s_initial_create_8_designer_8cs.html index f021ee896c..b002c1ff88 100644 --- a/20180906135553___m_s_initial_create_8_designer_8cs.html +++ b/20180906135553___m_s_initial_create_8_designer_8cs.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180906135553_MSInitialCreate.Designer.cs File Reference +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180906135553_MSInitialCreate.Designer.cs File Reference @@ -63,7 +63,7 @@ $(function() {
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MSInitialCreate
 The initial database migration for MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MSInitialCreate
 The initial database migration for MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180906135553___m_s_initial_create_8_designer_8cs_source.html b/20180906135553___m_s_initial_create_8_designer_8cs_source.html index 47565ff620..8c26fd1e17 100644 --- a/20180906135553___m_s_initial_create_8_designer_8cs_source.html +++ b/20180906135553___m_s_initial_create_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180906135553_MSInitialCreate.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180906135553_MSInitialCreate.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20180906135553_MSInitialCreate.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
9 
11 {
13  [Migration("20180906135553_MSInitialCreate")]
14  partial class MSInitialCreate
15  {
20  protected override void BuildTargetModel(ModelBuilder modelBuilder)
21  {
22 #pragma warning disable 612, 618
23  modelBuilder
24  .HasAnnotation("ProductVersion", "2.1.2-rtm-30932")
25  .HasAnnotation("Relational:MaxIdentifierLength", 128)
26  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
27 
28  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
29  {
30  b.Property<long>("Id")
31  .ValueGeneratedOnAdd()
32  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
33 
34  b.Property<string>("ConnectionString")
35  .IsRequired();
36 
37  b.Property<bool?>("Enabled");
38 
39  b.Property<long>("InstanceId");
40 
41  b.Property<string>("Name")
42  .IsRequired();
43 
44  b.Property<int?>("Provider");
45 
46  b.HasKey("Id");
47 
48  b.HasIndex("InstanceId");
49 
50  b.HasIndex("Name")
51  .IsUnique();
52 
53  b.ToTable("ChatBots");
54  });
55 
56  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
57  {
58  b.Property<long>("Id")
59  .ValueGeneratedOnAdd()
60  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
61 
62  b.Property<long>("ChatSettingsId");
63 
64  b.Property<decimal?>("DiscordChannelId")
65  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
66 
67  b.Property<string>("IrcChannel");
68 
69  b.Property<bool?>("IsAdminChannel")
70  .IsRequired();
71 
72  b.Property<bool?>("IsUpdatesChannel")
73  .IsRequired();
74 
75  b.Property<bool?>("IsWatchdogChannel")
76  .IsRequired();
77 
78  b.Property<string>("Tag");
79 
80  b.HasKey("Id");
81 
82  b.HasIndex("ChatSettingsId", "DiscordChannelId")
83  .IsUnique()
84  .HasFilter("[DiscordChannelId] IS NOT NULL");
85 
86  b.HasIndex("ChatSettingsId", "IrcChannel")
87  .IsUnique()
88  .HasFilter("[IrcChannel] IS NOT NULL");
89 
90  b.ToTable("ChatChannels");
91  });
92 
93  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
94  {
95  b.Property<long>("Id")
96  .ValueGeneratedOnAdd()
97  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
98 
99  b.Property<string>("ByondVersion")
100  .IsRequired();
101 
102  b.Property<Guid?>("DirectoryName");
103 
104  b.Property<string>("DmeName");
105 
106  b.Property<long?>("JobId");
107 
108  b.Property<string>("Output");
109 
110  b.Property<long>("RevisionInformationId");
111 
112  b.HasKey("Id");
113 
114  b.HasIndex("DirectoryName");
115 
116  b.HasIndex("JobId");
117 
118  b.HasIndex("RevisionInformationId");
119 
120  b.ToTable("CompileJobs");
121  });
122 
123  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
124  {
125  b.Property<long>("Id")
126  .ValueGeneratedOnAdd()
127  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
128 
129  b.Property<string>("AccessToken");
130 
131  b.Property<bool?>("AllowWebClient")
132  .IsRequired();
133 
134  b.Property<bool?>("AutoStart")
135  .IsRequired();
136 
137  b.Property<long>("InstanceId");
138 
139  b.Property<int>("PrimaryPort");
140 
141  b.Property<int?>("ProcessId");
142 
143  b.Property<int>("SecondaryPort");
144 
145  b.Property<int>("SecurityLevel");
146 
147  b.Property<bool?>("SoftRestart")
148  .IsRequired();
149 
150  b.Property<bool?>("SoftShutdown")
151  .IsRequired();
152 
153  b.Property<long>("StartupTimeout");
154 
155  b.HasKey("Id");
156 
157  b.HasIndex("InstanceId")
158  .IsUnique();
159 
160  b.ToTable("DreamDaemonSettings");
161  });
162 
163  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
164  {
165  b.Property<long>("Id")
166  .ValueGeneratedOnAdd()
167  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
168 
169  b.Property<int>("ApiValidationPort");
170 
171  b.Property<long>("InstanceId");
172 
173  b.Property<string>("ProjectName");
174 
175  b.HasKey("Id");
176 
177  b.HasIndex("InstanceId")
178  .IsUnique();
179 
180  b.ToTable("DreamMakerSettings");
181  });
182 
183  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
184  {
185  b.Property<long>("Id")
186  .ValueGeneratedOnAdd()
187  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
188 
189  b.Property<long>("AutoUpdateInterval");
190 
191  b.Property<int>("ConfigurationType");
192 
193  b.Property<string>("Name")
194  .IsRequired();
195 
196  b.Property<bool?>("Online")
197  .IsRequired();
198 
199  b.Property<string>("Path")
200  .IsRequired();
201 
202  b.Property<long?>("WatchdogReattachInformationId");
203 
204  b.HasKey("Id");
205 
206  b.HasIndex("Path")
207  .IsUnique();
208 
209  b.HasIndex("WatchdogReattachInformationId");
210 
211  b.ToTable("Instances");
212  });
213 
214  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
215  {
216  b.Property<long>("Id")
217  .ValueGeneratedOnAdd()
218  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
219 
220  b.Property<decimal>("ByondRights")
221  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
222 
223  b.Property<decimal>("ChatBotRights")
224  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
225 
226  b.Property<decimal>("ConfigurationRights")
227  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
228 
229  b.Property<decimal>("DreamDaemonRights")
230  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
231 
232  b.Property<decimal>("DreamMakerRights")
233  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
234 
235  b.Property<long>("InstanceId");
236 
237  b.Property<decimal>("InstanceUserRights")
238  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
239 
240  b.Property<decimal>("RepositoryRights")
241  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
242 
243  b.Property<long?>("UserId")
244  .IsRequired();
245 
246  b.HasKey("Id");
247 
248  b.HasIndex("InstanceId");
249 
250  b.HasIndex("UserId", "InstanceId")
251  .IsUnique();
252 
253  b.ToTable("InstanceUsers");
254  });
255 
256  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
257  {
258  b.Property<long>("Id")
259  .ValueGeneratedOnAdd()
260  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
261 
262  b.Property<decimal?>("CancelRight")
263  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
264 
265  b.Property<decimal?>("CancelRightsType")
266  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
267 
268  b.Property<bool?>("Cancelled")
269  .IsRequired();
270 
271  b.Property<long?>("CancelledById");
272 
273  b.Property<string>("Description")
274  .IsRequired();
275 
276  b.Property<string>("ExceptionDetails");
277 
278  b.Property<long>("InstanceId");
279 
280  b.Property<DateTimeOffset?>("StartedAt")
281  .IsRequired();
282 
283  b.Property<long>("StartedById");
284 
285  b.Property<DateTimeOffset?>("StoppedAt");
286 
287  b.HasKey("Id");
288 
289  b.HasIndex("CancelledById");
290 
291  b.HasIndex("InstanceId");
292 
293  b.HasIndex("StartedById");
294 
295  b.ToTable("Jobs");
296  });
297 
298  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
299  {
300  b.Property<long>("Id")
301  .ValueGeneratedOnAdd()
302  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
303 
304  b.Property<string>("AccessIdentifier")
305  .IsRequired();
306 
307  b.Property<string>("ChatChannelsJson")
308  .IsRequired();
309 
310  b.Property<string>("ChatCommandsJson")
311  .IsRequired();
312 
313  b.Property<long?>("CompileJobId");
314 
315  b.Property<bool>("IsPrimary");
316 
317  b.Property<int>("Port");
318 
319  b.Property<int>("ProcessId");
320 
321  b.Property<int>("RebootState");
322 
323  b.Property<string>("ServerCommandsJson")
324  .IsRequired();
325 
326  b.HasKey("Id");
327 
328  b.HasIndex("CompileJobId");
329 
330  b.ToTable("ReattachInformations");
331  });
332 
333  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
334  {
335  b.Property<long>("Id")
336  .ValueGeneratedOnAdd()
337  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
338 
339  b.Property<string>("AccessToken");
340 
341  b.Property<string>("AccessUser");
342 
343  b.Property<bool?>("AutoUpdatesKeepTestMerges")
344  .IsRequired();
345 
346  b.Property<bool?>("AutoUpdatesSynchronize")
347  .IsRequired();
348 
349  b.Property<string>("CommitterEmail")
350  .IsRequired();
351 
352  b.Property<string>("CommitterName")
353  .IsRequired();
354 
355  b.Property<long>("InstanceId");
356 
357  b.Property<bool?>("PushTestMergeCommits")
358  .IsRequired();
359 
360  b.Property<bool?>("ShowTestMergeCommitters")
361  .IsRequired();
362 
363  b.HasKey("Id");
364 
365  b.HasIndex("InstanceId")
366  .IsUnique();
367 
368  b.ToTable("RepositorySettings");
369  });
370 
371  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
372  {
373  b.Property<long>("Id")
374  .ValueGeneratedOnAdd()
375  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
376 
377  b.Property<long>("RevisionInformationId");
378 
379  b.Property<long>("TestMergeId");
380 
381  b.HasKey("Id");
382 
383  b.HasIndex("RevisionInformationId");
384 
385  b.HasIndex("TestMergeId");
386 
387  b.ToTable("RevInfoTestMerges");
388  });
389 
390  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
391  {
392  b.Property<long>("Id")
393  .ValueGeneratedOnAdd()
394  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
395 
396  b.Property<string>("CommitSha")
397  .IsRequired()
398  .HasMaxLength(40);
399 
400  b.Property<long>("InstanceId");
401 
402  b.Property<string>("OriginCommitSha")
403  .IsRequired()
404  .HasMaxLength(40);
405 
406  b.HasKey("Id");
407 
408  b.HasIndex("CommitSha")
409  .IsUnique();
410 
411  b.HasIndex("InstanceId");
412 
413  b.ToTable("RevisionInformations");
414  });
415 
416  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
417  {
418  b.Property<long>("Id")
419  .ValueGeneratedOnAdd()
420  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
421 
422  b.Property<string>("Author")
423  .IsRequired();
424 
425  b.Property<string>("BodyAtMerge")
426  .IsRequired();
427 
428  b.Property<string>("Comment");
429 
430  b.Property<DateTimeOffset>("MergedAt");
431 
432  b.Property<long>("MergedById");
433 
434  b.Property<int?>("Number")
435  .IsRequired();
436 
437  b.Property<long?>("PrimaryRevisionInformationId");
438 
439  b.Property<string>("PullRequestRevision")
440  .IsRequired();
441 
442  b.Property<string>("TitleAtMerge")
443  .IsRequired();
444 
445  b.Property<string>("Url")
446  .IsRequired();
447 
448  b.HasKey("Id");
449 
450  b.HasIndex("MergedById");
451 
452  b.HasIndex("PrimaryRevisionInformationId")
453  .IsUnique()
454  .HasFilter("[PrimaryRevisionInformationId] IS NOT NULL");
455 
456  b.ToTable("TestMerges");
457  });
458 
459  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
460  {
461  b.Property<long>("Id")
462  .ValueGeneratedOnAdd()
463  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
464 
465  b.Property<decimal>("AdministrationRights")
466  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
467 
468  b.Property<string>("CanonicalName")
469  .IsRequired();
470 
471  b.Property<DateTimeOffset?>("CreatedAt")
472  .IsRequired();
473 
474  b.Property<long?>("CreatedById");
475 
476  b.Property<bool?>("Enabled")
477  .IsRequired();
478 
479  b.Property<decimal>("InstanceManagerRights")
480  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
481 
482  b.Property<DateTimeOffset?>("LastPasswordUpdate");
483 
484  b.Property<string>("Name")
485  .IsRequired();
486 
487  b.Property<string>("PasswordHash");
488 
489  b.Property<string>("SystemIdentifier");
490 
491  b.HasKey("Id");
492 
493  b.HasIndex("CanonicalName")
494  .IsUnique();
495 
496  b.HasIndex("CreatedById");
497 
498  b.ToTable("Users");
499  });
500 
501  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
502  {
503  b.Property<long>("Id")
504  .ValueGeneratedOnAdd()
505  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
506 
507  b.Property<long?>("AlphaId");
508 
509  b.Property<bool>("AlphaIsActive");
510 
511  b.Property<long?>("BravoId");
512 
513  b.HasKey("Id");
514 
515  b.HasIndex("AlphaId");
516 
517  b.HasIndex("BravoId");
518 
519  b.ToTable("WatchdogReattachInformations");
520  });
521 
522  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
523  {
524  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
525  .WithMany("ChatSettings")
526  .HasForeignKey("InstanceId")
527  .OnDelete(DeleteBehavior.Cascade);
528  });
529 
530  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
531  {
532  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
533  .WithMany("Channels")
534  .HasForeignKey("ChatSettingsId")
535  .OnDelete(DeleteBehavior.Cascade);
536  });
537 
538  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
539  {
540  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
541  .WithMany()
542  .HasForeignKey("JobId");
543 
544  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
545  .WithMany("CompileJobs")
546  .HasForeignKey("RevisionInformationId")
547  .OnDelete(DeleteBehavior.Cascade);
548  });
549 
550  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
551  {
552  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
553  .WithOne("DreamDaemonSettings")
554  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
555  .OnDelete(DeleteBehavior.Cascade);
556  });
557 
558  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
559  {
560  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
561  .WithOne("DreamMakerSettings")
562  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
563  .OnDelete(DeleteBehavior.Cascade);
564  });
565 
566  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
567  {
568  b.HasOne("Tgstation.Server.Host.Models.WatchdogReattachInformation", "WatchdogReattachInformation")
569  .WithMany()
570  .HasForeignKey("WatchdogReattachInformationId");
571  });
572 
573  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
574  {
575  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
576  .WithMany("InstanceUsers")
577  .HasForeignKey("InstanceId")
578  .OnDelete(DeleteBehavior.Cascade);
579 
580  b.HasOne("Tgstation.Server.Host.Models.User")
581  .WithMany("InstanceUsers")
582  .HasForeignKey("UserId")
583  .OnDelete(DeleteBehavior.Cascade);
584  });
585 
586  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
587  {
588  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
589  .WithMany()
590  .HasForeignKey("CancelledById");
591 
592  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
593  .WithMany("Jobs")
594  .HasForeignKey("InstanceId")
595  .OnDelete(DeleteBehavior.Cascade);
596 
597  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
598  .WithMany()
599  .HasForeignKey("StartedById")
600  .OnDelete(DeleteBehavior.Cascade);
601  });
602 
603  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
604  {
605  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
606  .WithMany()
607  .HasForeignKey("CompileJobId");
608  });
609 
610  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
611  {
612  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
613  .WithOne("RepositorySettings")
614  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
615  .OnDelete(DeleteBehavior.Cascade);
616  });
617 
618  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
619  {
620  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
621  .WithMany("ActiveTestMerges")
622  .HasForeignKey("RevisionInformationId")
623  .OnDelete(DeleteBehavior.Cascade);
624 
625  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
626  .WithMany("RevisonInformations")
627  .HasForeignKey("TestMergeId")
628  .OnDelete(DeleteBehavior.Cascade);
629  });
630 
631  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
632  {
633  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
634  .WithMany("RevisionInformations")
635  .HasForeignKey("InstanceId")
636  .OnDelete(DeleteBehavior.Cascade);
637  });
638 
639  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
640  {
641  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
642  .WithMany("TestMerges")
643  .HasForeignKey("MergedById")
644  .OnDelete(DeleteBehavior.Restrict);
645 
646  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
647  .WithOne("PrimaryTestMerge")
648  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
649  .OnDelete(DeleteBehavior.SetNull);
650  });
651 
652  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
653  {
654  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
655  .WithMany("CreatedUsers")
656  .HasForeignKey("CreatedById");
657  });
658 
659  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
660  {
661  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
662  .WithMany()
663  .HasForeignKey("AlphaId");
664 
665  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
666  .WithMany()
667  .HasForeignKey("BravoId");
668  });
669 #pragma warning restore 612, 618
670  }
671  }
672 }
- +Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
8 
10 {
11  [DbContext(typeof(SqlServerDatabaseContext))]
12  [Migration("20180906135553_MSInitialCreate")]
13  partial class MSInitialCreate
14  {
19  protected override void BuildTargetModel(ModelBuilder modelBuilder)
20  {
21 #pragma warning disable 612, 618
22  modelBuilder
23  .HasAnnotation("ProductVersion", "2.1.2-rtm-30932")
24  .HasAnnotation("Relational:MaxIdentifierLength", 128)
25  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
26 
27  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
28  {
29  b.Property<long>("Id")
30  .ValueGeneratedOnAdd()
31  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
32 
33  b.Property<string>("ConnectionString")
34  .IsRequired();
35 
36  b.Property<bool?>("Enabled");
37 
38  b.Property<long>("InstanceId");
39 
40  b.Property<string>("Name")
41  .IsRequired();
42 
43  b.Property<int?>("Provider");
44 
45  b.HasKey("Id");
46 
47  b.HasIndex("InstanceId");
48 
49  b.HasIndex("Name")
50  .IsUnique();
51 
52  b.ToTable("ChatBots");
53  });
54 
55  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
56  {
57  b.Property<long>("Id")
58  .ValueGeneratedOnAdd()
59  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
60 
61  b.Property<long>("ChatSettingsId");
62 
63  b.Property<decimal?>("DiscordChannelId")
64  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
65 
66  b.Property<string>("IrcChannel");
67 
68  b.Property<bool?>("IsAdminChannel")
69  .IsRequired();
70 
71  b.Property<bool?>("IsUpdatesChannel")
72  .IsRequired();
73 
74  b.Property<bool?>("IsWatchdogChannel")
75  .IsRequired();
76 
77  b.Property<string>("Tag");
78 
79  b.HasKey("Id");
80 
81  b.HasIndex("ChatSettingsId", "DiscordChannelId")
82  .IsUnique()
83  .HasFilter("[DiscordChannelId] IS NOT NULL");
84 
85  b.HasIndex("ChatSettingsId", "IrcChannel")
86  .IsUnique()
87  .HasFilter("[IrcChannel] IS NOT NULL");
88 
89  b.ToTable("ChatChannels");
90  });
91 
92  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
93  {
94  b.Property<long>("Id")
95  .ValueGeneratedOnAdd()
96  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
97 
98  b.Property<string>("ByondVersion")
99  .IsRequired();
100 
101  b.Property<Guid?>("DirectoryName");
102 
103  b.Property<string>("DmeName");
104 
105  b.Property<long?>("JobId");
106 
107  b.Property<string>("Output");
108 
109  b.Property<long>("RevisionInformationId");
110 
111  b.HasKey("Id");
112 
113  b.HasIndex("DirectoryName");
114 
115  b.HasIndex("JobId");
116 
117  b.HasIndex("RevisionInformationId");
118 
119  b.ToTable("CompileJobs");
120  });
121 
122  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
123  {
124  b.Property<long>("Id")
125  .ValueGeneratedOnAdd()
126  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
127 
128  b.Property<string>("AccessToken");
129 
130  b.Property<bool?>("AllowWebClient")
131  .IsRequired();
132 
133  b.Property<bool?>("AutoStart")
134  .IsRequired();
135 
136  b.Property<long>("InstanceId");
137 
138  b.Property<int>("PrimaryPort");
139 
140  b.Property<int?>("ProcessId");
141 
142  b.Property<int>("SecondaryPort");
143 
144  b.Property<int>("SecurityLevel");
145 
146  b.Property<bool?>("SoftRestart")
147  .IsRequired();
148 
149  b.Property<bool?>("SoftShutdown")
150  .IsRequired();
151 
152  b.Property<long>("StartupTimeout");
153 
154  b.HasKey("Id");
155 
156  b.HasIndex("InstanceId")
157  .IsUnique();
158 
159  b.ToTable("DreamDaemonSettings");
160  });
161 
162  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
163  {
164  b.Property<long>("Id")
165  .ValueGeneratedOnAdd()
166  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
167 
168  b.Property<int>("ApiValidationPort");
169 
170  b.Property<long>("InstanceId");
171 
172  b.Property<string>("ProjectName");
173 
174  b.HasKey("Id");
175 
176  b.HasIndex("InstanceId")
177  .IsUnique();
178 
179  b.ToTable("DreamMakerSettings");
180  });
181 
182  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
183  {
184  b.Property<long>("Id")
185  .ValueGeneratedOnAdd()
186  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
187 
188  b.Property<long>("AutoUpdateInterval");
189 
190  b.Property<int>("ConfigurationType");
191 
192  b.Property<string>("Name")
193  .IsRequired();
194 
195  b.Property<bool?>("Online")
196  .IsRequired();
197 
198  b.Property<string>("Path")
199  .IsRequired();
200 
201  b.Property<long?>("WatchdogReattachInformationId");
202 
203  b.HasKey("Id");
204 
205  b.HasIndex("Path")
206  .IsUnique();
207 
208  b.HasIndex("WatchdogReattachInformationId");
209 
210  b.ToTable("Instances");
211  });
212 
213  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
214  {
215  b.Property<long>("Id")
216  .ValueGeneratedOnAdd()
217  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
218 
219  b.Property<decimal>("ByondRights")
220  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
221 
222  b.Property<decimal>("ChatBotRights")
223  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
224 
225  b.Property<decimal>("ConfigurationRights")
226  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
227 
228  b.Property<decimal>("DreamDaemonRights")
229  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
230 
231  b.Property<decimal>("DreamMakerRights")
232  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
233 
234  b.Property<long>("InstanceId");
235 
236  b.Property<decimal>("InstanceUserRights")
237  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
238 
239  b.Property<decimal>("RepositoryRights")
240  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
241 
242  b.Property<long?>("UserId")
243  .IsRequired();
244 
245  b.HasKey("Id");
246 
247  b.HasIndex("InstanceId");
248 
249  b.HasIndex("UserId", "InstanceId")
250  .IsUnique();
251 
252  b.ToTable("InstanceUsers");
253  });
254 
255  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
256  {
257  b.Property<long>("Id")
258  .ValueGeneratedOnAdd()
259  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
260 
261  b.Property<decimal?>("CancelRight")
262  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
263 
264  b.Property<decimal?>("CancelRightsType")
265  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
266 
267  b.Property<bool?>("Cancelled")
268  .IsRequired();
269 
270  b.Property<long?>("CancelledById");
271 
272  b.Property<string>("Description")
273  .IsRequired();
274 
275  b.Property<string>("ExceptionDetails");
276 
277  b.Property<long>("InstanceId");
278 
279  b.Property<DateTimeOffset?>("StartedAt")
280  .IsRequired();
281 
282  b.Property<long>("StartedById");
283 
284  b.Property<DateTimeOffset?>("StoppedAt");
285 
286  b.HasKey("Id");
287 
288  b.HasIndex("CancelledById");
289 
290  b.HasIndex("InstanceId");
291 
292  b.HasIndex("StartedById");
293 
294  b.ToTable("Jobs");
295  });
296 
297  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
298  {
299  b.Property<long>("Id")
300  .ValueGeneratedOnAdd()
301  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
302 
303  b.Property<string>("AccessIdentifier")
304  .IsRequired();
305 
306  b.Property<string>("ChatChannelsJson")
307  .IsRequired();
308 
309  b.Property<string>("ChatCommandsJson")
310  .IsRequired();
311 
312  b.Property<long?>("CompileJobId");
313 
314  b.Property<bool>("IsPrimary");
315 
316  b.Property<int>("Port");
317 
318  b.Property<int>("ProcessId");
319 
320  b.Property<int>("RebootState");
321 
322  b.Property<string>("ServerCommandsJson")
323  .IsRequired();
324 
325  b.HasKey("Id");
326 
327  b.HasIndex("CompileJobId");
328 
329  b.ToTable("ReattachInformations");
330  });
331 
332  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
333  {
334  b.Property<long>("Id")
335  .ValueGeneratedOnAdd()
336  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
337 
338  b.Property<string>("AccessToken");
339 
340  b.Property<string>("AccessUser");
341 
342  b.Property<bool?>("AutoUpdatesKeepTestMerges")
343  .IsRequired();
344 
345  b.Property<bool?>("AutoUpdatesSynchronize")
346  .IsRequired();
347 
348  b.Property<string>("CommitterEmail")
349  .IsRequired();
350 
351  b.Property<string>("CommitterName")
352  .IsRequired();
353 
354  b.Property<long>("InstanceId");
355 
356  b.Property<bool?>("PushTestMergeCommits")
357  .IsRequired();
358 
359  b.Property<bool?>("ShowTestMergeCommitters")
360  .IsRequired();
361 
362  b.HasKey("Id");
363 
364  b.HasIndex("InstanceId")
365  .IsUnique();
366 
367  b.ToTable("RepositorySettings");
368  });
369 
370  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
371  {
372  b.Property<long>("Id")
373  .ValueGeneratedOnAdd()
374  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
375 
376  b.Property<long>("RevisionInformationId");
377 
378  b.Property<long>("TestMergeId");
379 
380  b.HasKey("Id");
381 
382  b.HasIndex("RevisionInformationId");
383 
384  b.HasIndex("TestMergeId");
385 
386  b.ToTable("RevInfoTestMerges");
387  });
388 
389  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
390  {
391  b.Property<long>("Id")
392  .ValueGeneratedOnAdd()
393  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
394 
395  b.Property<string>("CommitSha")
396  .IsRequired()
397  .HasMaxLength(40);
398 
399  b.Property<long>("InstanceId");
400 
401  b.Property<string>("OriginCommitSha")
402  .IsRequired()
403  .HasMaxLength(40);
404 
405  b.HasKey("Id");
406 
407  b.HasIndex("CommitSha")
408  .IsUnique();
409 
410  b.HasIndex("InstanceId");
411 
412  b.ToTable("RevisionInformations");
413  });
414 
415  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
416  {
417  b.Property<long>("Id")
418  .ValueGeneratedOnAdd()
419  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
420 
421  b.Property<string>("Author")
422  .IsRequired();
423 
424  b.Property<string>("BodyAtMerge")
425  .IsRequired();
426 
427  b.Property<string>("Comment");
428 
429  b.Property<DateTimeOffset>("MergedAt");
430 
431  b.Property<long>("MergedById");
432 
433  b.Property<int?>("Number")
434  .IsRequired();
435 
436  b.Property<long?>("PrimaryRevisionInformationId");
437 
438  b.Property<string>("PullRequestRevision")
439  .IsRequired();
440 
441  b.Property<string>("TitleAtMerge")
442  .IsRequired();
443 
444  b.Property<string>("Url")
445  .IsRequired();
446 
447  b.HasKey("Id");
448 
449  b.HasIndex("MergedById");
450 
451  b.HasIndex("PrimaryRevisionInformationId")
452  .IsUnique()
453  .HasFilter("[PrimaryRevisionInformationId] IS NOT NULL");
454 
455  b.ToTable("TestMerges");
456  });
457 
458  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
459  {
460  b.Property<long>("Id")
461  .ValueGeneratedOnAdd()
462  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
463 
464  b.Property<decimal>("AdministrationRights")
465  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
466 
467  b.Property<string>("CanonicalName")
468  .IsRequired();
469 
470  b.Property<DateTimeOffset?>("CreatedAt")
471  .IsRequired();
472 
473  b.Property<long?>("CreatedById");
474 
475  b.Property<bool?>("Enabled")
476  .IsRequired();
477 
478  b.Property<decimal>("InstanceManagerRights")
479  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
480 
481  b.Property<DateTimeOffset?>("LastPasswordUpdate");
482 
483  b.Property<string>("Name")
484  .IsRequired();
485 
486  b.Property<string>("PasswordHash");
487 
488  b.Property<string>("SystemIdentifier");
489 
490  b.HasKey("Id");
491 
492  b.HasIndex("CanonicalName")
493  .IsUnique();
494 
495  b.HasIndex("CreatedById");
496 
497  b.ToTable("Users");
498  });
499 
500  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
501  {
502  b.Property<long>("Id")
503  .ValueGeneratedOnAdd()
504  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
505 
506  b.Property<long?>("AlphaId");
507 
508  b.Property<bool>("AlphaIsActive");
509 
510  b.Property<long?>("BravoId");
511 
512  b.HasKey("Id");
513 
514  b.HasIndex("AlphaId");
515 
516  b.HasIndex("BravoId");
517 
518  b.ToTable("WatchdogReattachInformations");
519  });
520 
521  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
522  {
523  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
524  .WithMany("ChatSettings")
525  .HasForeignKey("InstanceId")
526  .OnDelete(DeleteBehavior.Cascade);
527  });
528 
529  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
530  {
531  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
532  .WithMany("Channels")
533  .HasForeignKey("ChatSettingsId")
534  .OnDelete(DeleteBehavior.Cascade);
535  });
536 
537  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
538  {
539  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
540  .WithMany()
541  .HasForeignKey("JobId");
542 
543  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
544  .WithMany("CompileJobs")
545  .HasForeignKey("RevisionInformationId")
546  .OnDelete(DeleteBehavior.Cascade);
547  });
548 
549  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
550  {
551  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
552  .WithOne("DreamDaemonSettings")
553  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
554  .OnDelete(DeleteBehavior.Cascade);
555  });
556 
557  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
558  {
559  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
560  .WithOne("DreamMakerSettings")
561  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
562  .OnDelete(DeleteBehavior.Cascade);
563  });
564 
565  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
566  {
567  b.HasOne("Tgstation.Server.Host.Models.WatchdogReattachInformation", "WatchdogReattachInformation")
568  .WithMany()
569  .HasForeignKey("WatchdogReattachInformationId");
570  });
571 
572  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
573  {
574  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
575  .WithMany("InstanceUsers")
576  .HasForeignKey("InstanceId")
577  .OnDelete(DeleteBehavior.Cascade);
578 
579  b.HasOne("Tgstation.Server.Host.Models.User")
580  .WithMany("InstanceUsers")
581  .HasForeignKey("UserId")
582  .OnDelete(DeleteBehavior.Cascade);
583  });
584 
585  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
586  {
587  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
588  .WithMany()
589  .HasForeignKey("CancelledById");
590 
591  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
592  .WithMany("Jobs")
593  .HasForeignKey("InstanceId")
594  .OnDelete(DeleteBehavior.Cascade);
595 
596  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
597  .WithMany()
598  .HasForeignKey("StartedById")
599  .OnDelete(DeleteBehavior.Cascade);
600  });
601 
602  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
603  {
604  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
605  .WithMany()
606  .HasForeignKey("CompileJobId");
607  });
608 
609  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
610  {
611  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
612  .WithOne("RepositorySettings")
613  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
614  .OnDelete(DeleteBehavior.Cascade);
615  });
616 
617  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
618  {
619  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
620  .WithMany("ActiveTestMerges")
621  .HasForeignKey("RevisionInformationId")
622  .OnDelete(DeleteBehavior.Cascade);
623 
624  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
625  .WithMany("RevisonInformations")
626  .HasForeignKey("TestMergeId")
627  .OnDelete(DeleteBehavior.Cascade);
628  });
629 
630  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
631  {
632  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
633  .WithMany("RevisionInformations")
634  .HasForeignKey("InstanceId")
635  .OnDelete(DeleteBehavior.Cascade);
636  });
637 
638  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
639  {
640  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
641  .WithMany("TestMerges")
642  .HasForeignKey("MergedById")
643  .OnDelete(DeleteBehavior.Restrict);
644 
645  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
646  .WithOne("PrimaryTestMerge")
647  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
648  .OnDelete(DeleteBehavior.SetNull);
649  });
650 
651  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
652  {
653  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
654  .WithMany("CreatedUsers")
655  .HasForeignKey("CreatedById");
656  });
657 
658  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
659  {
660  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
661  .WithMany()
662  .HasForeignKey("AlphaId");
663 
664  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
665  .WithMany()
666  .HasForeignKey("BravoId");
667  });
668 #pragma warning restore 612, 618
669  }
670  }
671 }
-
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
- -
DatabaseContext<TParentContext> for Sqlserver
- - - +
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
+
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MSInitialCreate
 The initial database migration for MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MSInitialCreate
 The initial database migration for MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180906135553___m_s_initial_create_8cs_source.html b/20180906135553___m_s_initial_create_8cs_source.html index 29a41f29d9..49f3c7bc33 100644 --- a/20180906135553___m_s_initial_create_8cs_source.html +++ b/20180906135553___m_s_initial_create_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180906135553_MSInitialCreate.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180906135553_MSInitialCreate.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,20 +71,20 @@ $(function() {
20180906135553_MSInitialCreate.cs
-Go to the documentation of this file.
1 using System;
2 using Microsoft.EntityFrameworkCore.Metadata;
3 using Microsoft.EntityFrameworkCore.Migrations;
4 
6 {
10  #pragma warning disable CA1506
11  public partial class MSInitialCreate : Migration
12  {
17  protected override void Up(MigrationBuilder migrationBuilder)
18  {
19  if (migrationBuilder == null)
20  throw new ArgumentNullException(nameof(migrationBuilder));
21 
22  migrationBuilder.CreateTable(
23  name: "Users",
24  columns: table => new
25  {
26  Id = table.Column<long>(nullable: false)
27  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
28  Enabled = table.Column<bool>(nullable: false),
29  CreatedAt = table.Column<DateTimeOffset>(nullable: false),
30  SystemIdentifier = table.Column<string>(nullable: true),
31  Name = table.Column<string>(nullable: false),
32  AdministrationRights = table.Column<decimal>(nullable: false),
33  InstanceManagerRights = table.Column<decimal>(nullable: false),
34  PasswordHash = table.Column<string>(nullable: true),
35  CreatedById = table.Column<long>(nullable: true),
36  CanonicalName = table.Column<string>(nullable: false),
37  LastPasswordUpdate = table.Column<DateTimeOffset>(nullable: true)
38  },
39  constraints: table =>
40  {
41  table.PrimaryKey("PK_Users", x => x.Id);
42  table.ForeignKey(
43  name: "FK_Users_Users_CreatedById",
44  column: x => x.CreatedById,
45  principalTable: "Users",
46  principalColumn: "Id",
47  onDelete: ReferentialAction.Restrict);
48  });
49 
50  migrationBuilder.CreateTable(
51  name: "ChatChannels",
52  columns: table => new
53  {
54  IrcChannel = table.Column<string>(nullable: true),
55  DiscordChannelId = table.Column<decimal>(nullable: true),
56  IsAdminChannel = table.Column<bool>(nullable: false),
57  IsWatchdogChannel = table.Column<bool>(nullable: false),
58  IsUpdatesChannel = table.Column<bool>(nullable: false),
59  Tag = table.Column<string>(nullable: true),
60  Id = table.Column<long>(nullable: false)
61  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
62  ChatSettingsId = table.Column<long>(nullable: false)
63  },
64  constraints: table =>
65  {
66  table.PrimaryKey("PK_ChatChannels", x => x.Id);
67  });
68 
69  migrationBuilder.CreateTable(
70  name: "ReattachInformations",
71  columns: table => new
72  {
73  ChatCommandsJson = table.Column<string>(nullable: false),
74  ChatChannelsJson = table.Column<string>(nullable: false),
75  ServerCommandsJson = table.Column<string>(nullable: false),
76  AccessIdentifier = table.Column<string>(nullable: false),
77  ProcessId = table.Column<int>(nullable: false),
78  IsPrimary = table.Column<bool>(nullable: false),
79  Port = table.Column<int>(nullable: false),
80  RebootState = table.Column<int>(nullable: false),
81  Id = table.Column<long>(nullable: false)
82  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
83  CompileJobId = table.Column<long>(nullable: true)
84  },
85  constraints: table =>
86  {
87  table.PrimaryKey("PK_ReattachInformations", x => x.Id);
88  });
89 
90  migrationBuilder.CreateTable(
91  name: "WatchdogReattachInformations",
92  columns: table => new
93  {
94  AlphaIsActive = table.Column<bool>(nullable: false),
95  Id = table.Column<long>(nullable: false)
96  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
97  AlphaId = table.Column<long>(nullable: true),
98  BravoId = table.Column<long>(nullable: true)
99  },
100  constraints: table =>
101  {
102  table.PrimaryKey("PK_WatchdogReattachInformations", x => x.Id);
103  table.ForeignKey(
104  name: "FK_WatchdogReattachInformations_ReattachInformations_AlphaId",
105  column: x => x.AlphaId,
106  principalTable: "ReattachInformations",
107  principalColumn: "Id",
108  onDelete: ReferentialAction.Restrict);
109  table.ForeignKey(
110  name: "FK_WatchdogReattachInformations_ReattachInformations_BravoId",
111  column: x => x.BravoId,
112  principalTable: "ReattachInformations",
113  principalColumn: "Id",
114  onDelete: ReferentialAction.Restrict);
115  });
116 
117  migrationBuilder.CreateTable(
118  name: "Instances",
119  columns: table => new
120  {
121  Id = table.Column<long>(nullable: false)
122  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
123  Name = table.Column<string>(nullable: false),
124  Path = table.Column<string>(nullable: false),
125  Online = table.Column<bool>(nullable: false),
126  ConfigurationType = table.Column<int>(nullable: false),
127  AutoUpdateInterval = table.Column<long>(nullable: false),
128  WatchdogReattachInformationId = table.Column<long>(nullable: true)
129  },
130  constraints: table =>
131  {
132  table.PrimaryKey("PK_Instances", x => x.Id);
133  table.ForeignKey(
134  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInformationId",
135  column: x => x.WatchdogReattachInformationId,
136  principalTable: "WatchdogReattachInformations",
137  principalColumn: "Id",
138  onDelete: ReferentialAction.Restrict);
139  });
140 
141  migrationBuilder.CreateTable(
142  name: "ChatBots",
143  columns: table => new
144  {
145  Id = table.Column<long>(nullable: false)
146  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
147  Name = table.Column<string>(nullable: false),
148  Enabled = table.Column<bool>(nullable: true),
149  Provider = table.Column<int>(nullable: true),
150  ConnectionString = table.Column<string>(nullable: false),
151  InstanceId = table.Column<long>(nullable: false)
152  },
153  constraints: table =>
154  {
155  table.PrimaryKey("PK_ChatBots", x => x.Id);
156  table.ForeignKey(
157  name: "FK_ChatBots_Instances_InstanceId",
158  column: x => x.InstanceId,
159  principalTable: "Instances",
160  principalColumn: "Id",
161  onDelete: ReferentialAction.Cascade);
162  });
163 
164  migrationBuilder.CreateTable(
165  name: "DreamDaemonSettings",
166  columns: table => new
167  {
168  AllowWebClient = table.Column<bool>(nullable: false),
169  SecurityLevel = table.Column<int>(nullable: false),
170  PrimaryPort = table.Column<int>(nullable: false),
171  SecondaryPort = table.Column<int>(nullable: false),
172  StartupTimeout = table.Column<long>(nullable: false),
173  AutoStart = table.Column<bool>(nullable: false),
174  SoftRestart = table.Column<bool>(nullable: false),
175  SoftShutdown = table.Column<bool>(nullable: false),
176  Id = table.Column<long>(nullable: false)
177  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
178  ProcessId = table.Column<int>(nullable: true),
179  AccessToken = table.Column<string>(nullable: true),
180  InstanceId = table.Column<long>(nullable: false)
181  },
182  constraints: table =>
183  {
184  table.PrimaryKey("PK_DreamDaemonSettings", x => x.Id);
185  table.ForeignKey(
186  name: "FK_DreamDaemonSettings_Instances_InstanceId",
187  column: x => x.InstanceId,
188  principalTable: "Instances",
189  principalColumn: "Id",
190  onDelete: ReferentialAction.Cascade);
191  });
192 
193  migrationBuilder.CreateTable(
194  name: "DreamMakerSettings",
195  columns: table => new
196  {
197  ProjectName = table.Column<string>(nullable: true),
198  ApiValidationPort = table.Column<int>(nullable: false),
199  Id = table.Column<long>(nullable: false)
200  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
201  InstanceId = table.Column<long>(nullable: false)
202  },
203  constraints: table =>
204  {
205  table.PrimaryKey("PK_DreamMakerSettings", x => x.Id);
206  table.ForeignKey(
207  name: "FK_DreamMakerSettings_Instances_InstanceId",
208  column: x => x.InstanceId,
209  principalTable: "Instances",
210  principalColumn: "Id",
211  onDelete: ReferentialAction.Cascade);
212  });
213 
214  migrationBuilder.CreateTable(
215  name: "InstanceUsers",
216  columns: table => new
217  {
218  UserId = table.Column<long>(nullable: false),
219  InstanceUserRights = table.Column<decimal>(nullable: false),
220  ByondRights = table.Column<decimal>(nullable: false),
221  DreamDaemonRights = table.Column<decimal>(nullable: false),
222  DreamMakerRights = table.Column<decimal>(nullable: false),
223  RepositoryRights = table.Column<decimal>(nullable: false),
224  ChatBotRights = table.Column<decimal>(nullable: false),
225  ConfigurationRights = table.Column<decimal>(nullable: false),
226  Id = table.Column<long>(nullable: false)
227  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
228  InstanceId = table.Column<long>(nullable: false)
229  },
230  constraints: table =>
231  {
232  table.PrimaryKey("PK_InstanceUsers", x => x.Id);
233  table.ForeignKey(
234  name: "FK_InstanceUsers_Instances_InstanceId",
235  column: x => x.InstanceId,
236  principalTable: "Instances",
237  principalColumn: "Id",
238  onDelete: ReferentialAction.Cascade);
239  table.ForeignKey(
240  name: "FK_InstanceUsers_Users_UserId",
241  column: x => x.UserId,
242  principalTable: "Users",
243  principalColumn: "Id",
244  onDelete: ReferentialAction.Cascade);
245  });
246 
247  migrationBuilder.CreateTable(
248  name: "Jobs",
249  columns: table => new
250  {
251  Id = table.Column<long>(nullable: false)
252  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
253  Description = table.Column<string>(nullable: false),
254  ExceptionDetails = table.Column<string>(nullable: true),
255  StartedAt = table.Column<DateTimeOffset>(nullable: false),
256  StoppedAt = table.Column<DateTimeOffset>(nullable: true),
257  Cancelled = table.Column<bool>(nullable: false),
258  CancelRightsType = table.Column<decimal>(nullable: true),
259  CancelRight = table.Column<decimal>(nullable: true),
260  StartedById = table.Column<long>(nullable: false),
261  CancelledById = table.Column<long>(nullable: true),
262  InstanceId = table.Column<long>(nullable: false)
263  },
264  constraints: table =>
265  {
266  table.PrimaryKey("PK_Jobs", x => x.Id);
267  table.ForeignKey(
268  name: "FK_Jobs_Users_CancelledById",
269  column: x => x.CancelledById,
270  principalTable: "Users",
271  principalColumn: "Id",
272  onDelete: ReferentialAction.Restrict);
273  table.ForeignKey(
274  name: "FK_Jobs_Instances_InstanceId",
275  column: x => x.InstanceId,
276  principalTable: "Instances",
277  principalColumn: "Id",
278  onDelete: ReferentialAction.Cascade);
279  table.ForeignKey(
280  name: "FK_Jobs_Users_StartedById",
281  column: x => x.StartedById,
282  principalTable: "Users",
283  principalColumn: "Id",
284  onDelete: ReferentialAction.Cascade);
285  });
286 
287  migrationBuilder.CreateTable(
288  name: "RepositorySettings",
289  columns: table => new
290  {
291  CommitterName = table.Column<string>(nullable: false),
292  CommitterEmail = table.Column<string>(nullable: false),
293  AccessUser = table.Column<string>(nullable: true),
294  AccessToken = table.Column<string>(nullable: true),
295  PushTestMergeCommits = table.Column<bool>(nullable: false),
296  ShowTestMergeCommitters = table.Column<bool>(nullable: false),
297  AutoUpdatesKeepTestMerges = table.Column<bool>(nullable: false),
298  AutoUpdatesSynchronize = table.Column<bool>(nullable: false),
299  Id = table.Column<long>(nullable: false)
300  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
301  InstanceId = table.Column<long>(nullable: false)
302  },
303  constraints: table =>
304  {
305  table.PrimaryKey("PK_RepositorySettings", x => x.Id);
306  table.ForeignKey(
307  name: "FK_RepositorySettings_Instances_InstanceId",
308  column: x => x.InstanceId,
309  principalTable: "Instances",
310  principalColumn: "Id",
311  onDelete: ReferentialAction.Cascade);
312  });
313 
314  migrationBuilder.CreateTable(
315  name: "RevisionInformations",
316  columns: table => new
317  {
318  CommitSha = table.Column<string>(maxLength: 40, nullable: false),
319  OriginCommitSha = table.Column<string>(maxLength: 40, nullable: false),
320  Id = table.Column<long>(nullable: false)
321  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
322  InstanceId = table.Column<long>(nullable: false)
323  },
324  constraints: table =>
325  {
326  table.PrimaryKey("PK_RevisionInformations", x => x.Id);
327  table.ForeignKey(
328  name: "FK_RevisionInformations_Instances_InstanceId",
329  column: x => x.InstanceId,
330  principalTable: "Instances",
331  principalColumn: "Id",
332  onDelete: ReferentialAction.Cascade);
333  });
334 
335  migrationBuilder.CreateTable(
336  name: "CompileJobs",
337  columns: table => new
338  {
339  Id = table.Column<long>(nullable: false)
340  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
341  DmeName = table.Column<string>(nullable: true),
342  Output = table.Column<string>(nullable: true),
343  DirectoryName = table.Column<Guid>(nullable: true),
344  JobId = table.Column<long>(nullable: true),
345  RevisionInformationId = table.Column<long>(nullable: false),
346  ByondVersion = table.Column<string>(nullable: false)
347  },
348  constraints: table =>
349  {
350  table.PrimaryKey("PK_CompileJobs", x => x.Id);
351  table.ForeignKey(
352  name: "FK_CompileJobs_Jobs_JobId",
353  column: x => x.JobId,
354  principalTable: "Jobs",
355  principalColumn: "Id",
356  onDelete: ReferentialAction.Restrict);
357  table.ForeignKey(
358  name: "FK_CompileJobs_RevisionInformations_RevisionInformationId",
359  column: x => x.RevisionInformationId,
360  principalTable: "RevisionInformations",
361  principalColumn: "Id",
362  onDelete: ReferentialAction.Cascade);
363  });
364 
365  migrationBuilder.CreateTable(
366  name: "TestMerges",
367  columns: table => new
368  {
369  Number = table.Column<int>(nullable: false),
370  PullRequestRevision = table.Column<string>(nullable: false),
371  Comment = table.Column<string>(nullable: true),
372  TitleAtMerge = table.Column<string>(nullable: false),
373  BodyAtMerge = table.Column<string>(nullable: false),
374  Url = table.Column<string>(nullable: false),
375  Author = table.Column<string>(nullable: false),
376  Id = table.Column<long>(nullable: false)
377  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
378  MergedAt = table.Column<DateTimeOffset>(nullable: false),
379  MergedById = table.Column<long>(nullable: false),
380  PrimaryRevisionInformationId = table.Column<long>(nullable: true)
381  },
382  constraints: table =>
383  {
384  table.PrimaryKey("PK_TestMerges", x => x.Id);
385  table.ForeignKey(
386  name: "FK_TestMerges_Users_MergedById",
387  column: x => x.MergedById,
388  principalTable: "Users",
389  principalColumn: "Id",
390  onDelete: ReferentialAction.Restrict);
391  table.ForeignKey(
392  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
393  column: x => x.PrimaryRevisionInformationId,
394  principalTable: "RevisionInformations",
395  principalColumn: "Id",
396  onDelete: ReferentialAction.SetNull);
397  });
398 
399  migrationBuilder.CreateTable(
400  name: "RevInfoTestMerges",
401  columns: table => new
402  {
403  Id = table.Column<long>(nullable: false)
404  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
405  TestMergeId = table.Column<long>(nullable: false),
406  RevisionInformationId = table.Column<long>(nullable: false)
407  },
408  constraints: table =>
409  {
410  table.PrimaryKey("PK_RevInfoTestMerges", x => x.Id);
411  table.ForeignKey(
412  name: "FK_RevInfoTestMerges_RevisionInformations_RevisionInformationId",
413  column: x => x.RevisionInformationId,
414  principalTable: "RevisionInformations",
415  principalColumn: "Id",
416  onDelete: ReferentialAction.Cascade);
417  table.ForeignKey(
418  name: "FK_RevInfoTestMerges_TestMerges_TestMergeId",
419  column: x => x.TestMergeId,
420  principalTable: "TestMerges",
421  principalColumn: "Id",
422  onDelete: ReferentialAction.Cascade);
423  });
424 
425  migrationBuilder.CreateIndex(
426  name: "IX_ChatBots_InstanceId",
427  table: "ChatBots",
428  column: "InstanceId");
429 
430  migrationBuilder.CreateIndex(
431  name: "IX_ChatBots_Name",
432  table: "ChatBots",
433  column: "Name",
434  unique: true);
435 
436  migrationBuilder.CreateIndex(
437  name: "IX_ChatChannels_ChatSettingsId_DiscordChannelId",
438  table: "ChatChannels",
439  columns: new[] { "ChatSettingsId", "DiscordChannelId" },
440  unique: true,
441  filter: "[DiscordChannelId] IS NOT NULL");
442 
443  migrationBuilder.CreateIndex(
444  name: "IX_ChatChannels_ChatSettingsId_IrcChannel",
445  table: "ChatChannels",
446  columns: new[] { "ChatSettingsId", "IrcChannel" },
447  unique: true,
448  filter: "[IrcChannel] IS NOT NULL");
449 
450  migrationBuilder.CreateIndex(
451  name: "IX_CompileJobs_DirectoryName",
452  table: "CompileJobs",
453  column: "DirectoryName");
454 
455  migrationBuilder.CreateIndex(
456  name: "IX_CompileJobs_JobId",
457  table: "CompileJobs",
458  column: "JobId");
459 
460  migrationBuilder.CreateIndex(
461  name: "IX_CompileJobs_RevisionInformationId",
462  table: "CompileJobs",
463  column: "RevisionInformationId");
464 
465  migrationBuilder.CreateIndex(
466  name: "IX_DreamDaemonSettings_InstanceId",
467  table: "DreamDaemonSettings",
468  column: "InstanceId",
469  unique: true);
470 
471  migrationBuilder.CreateIndex(
472  name: "IX_DreamMakerSettings_InstanceId",
473  table: "DreamMakerSettings",
474  column: "InstanceId",
475  unique: true);
476 
477  migrationBuilder.CreateIndex(
478  name: "IX_Instances_Path",
479  table: "Instances",
480  column: "Path",
481  unique: true);
482 
483  migrationBuilder.CreateIndex(
484  name: "IX_Instances_WatchdogReattachInformationId",
485  table: "Instances",
486  column: "WatchdogReattachInformationId");
487 
488  migrationBuilder.CreateIndex(
489  name: "IX_InstanceUsers_InstanceId",
490  table: "InstanceUsers",
491  column: "InstanceId");
492 
493  migrationBuilder.CreateIndex(
494  name: "IX_InstanceUsers_UserId_InstanceId",
495  table: "InstanceUsers",
496  columns: new[] { "UserId", "InstanceId" },
497  unique: true);
498 
499  migrationBuilder.CreateIndex(
500  name: "IX_Jobs_CancelledById",
501  table: "Jobs",
502  column: "CancelledById");
503 
504  migrationBuilder.CreateIndex(
505  name: "IX_Jobs_InstanceId",
506  table: "Jobs",
507  column: "InstanceId");
508 
509  migrationBuilder.CreateIndex(
510  name: "IX_Jobs_StartedById",
511  table: "Jobs",
512  column: "StartedById");
513 
514  migrationBuilder.CreateIndex(
515  name: "IX_ReattachInformations_CompileJobId",
516  table: "ReattachInformations",
517  column: "CompileJobId");
518 
519  migrationBuilder.CreateIndex(
520  name: "IX_RepositorySettings_InstanceId",
521  table: "RepositorySettings",
522  column: "InstanceId",
523  unique: true);
524 
525  migrationBuilder.CreateIndex(
526  name: "IX_RevInfoTestMerges_RevisionInformationId",
527  table: "RevInfoTestMerges",
528  column: "RevisionInformationId");
529 
530  migrationBuilder.CreateIndex(
531  name: "IX_RevInfoTestMerges_TestMergeId",
532  table: "RevInfoTestMerges",
533  column: "TestMergeId");
534 
535  migrationBuilder.CreateIndex(
536  name: "IX_RevisionInformations_CommitSha",
537  table: "RevisionInformations",
538  column: "CommitSha",
539  unique: true);
540 
541  migrationBuilder.CreateIndex(
542  name: "IX_RevisionInformations_InstanceId",
543  table: "RevisionInformations",
544  column: "InstanceId");
545 
546  migrationBuilder.CreateIndex(
547  name: "IX_TestMerges_MergedById",
548  table: "TestMerges",
549  column: "MergedById");
550 
551  migrationBuilder.CreateIndex(
552  name: "IX_TestMerges_PrimaryRevisionInformationId",
553  table: "TestMerges",
554  column: "PrimaryRevisionInformationId",
555  unique: true,
556  filter: "[PrimaryRevisionInformationId] IS NOT NULL");
557 
558  migrationBuilder.CreateIndex(
559  name: "IX_Users_CanonicalName",
560  table: "Users",
561  column: "CanonicalName",
562  unique: true);
563 
564  migrationBuilder.CreateIndex(
565  name: "IX_Users_CreatedById",
566  table: "Users",
567  column: "CreatedById");
568 
569  migrationBuilder.CreateIndex(
570  name: "IX_WatchdogReattachInformations_AlphaId",
571  table: "WatchdogReattachInformations",
572  column: "AlphaId");
573 
574  migrationBuilder.CreateIndex(
575  name: "IX_WatchdogReattachInformations_BravoId",
576  table: "WatchdogReattachInformations",
577  column: "BravoId");
578 
579  migrationBuilder.AddForeignKey(
580  name: "FK_ChatChannels_ChatBots_ChatSettingsId",
581  table: "ChatChannels",
582  column: "ChatSettingsId",
583  principalTable: "ChatBots",
584  principalColumn: "Id",
585  onDelete: ReferentialAction.Cascade);
586 
587  migrationBuilder.AddForeignKey(
588  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
589  table: "ReattachInformations",
590  column: "CompileJobId",
591  principalTable: "CompileJobs",
592  principalColumn: "Id",
593  onDelete: ReferentialAction.Restrict);
594  }
595 
600  protected override void Down(MigrationBuilder migrationBuilder)
601  {
602  if (migrationBuilder == null)
603  throw new ArgumentNullException(nameof(migrationBuilder));
604 
605  migrationBuilder.DropForeignKey(
606  name: "FK_Jobs_Instances_InstanceId",
607  table: "Jobs");
608 
609  migrationBuilder.DropForeignKey(
610  name: "FK_RevisionInformations_Instances_InstanceId",
611  table: "RevisionInformations");
612 
613  migrationBuilder.DropTable(
614  name: "ChatChannels");
615 
616  migrationBuilder.DropTable(
617  name: "DreamDaemonSettings");
618 
619  migrationBuilder.DropTable(
620  name: "DreamMakerSettings");
621 
622  migrationBuilder.DropTable(
623  name: "InstanceUsers");
624 
625  migrationBuilder.DropTable(
626  name: "RepositorySettings");
627 
628  migrationBuilder.DropTable(
629  name: "RevInfoTestMerges");
630 
631  migrationBuilder.DropTable(
632  name: "ChatBots");
633 
634  migrationBuilder.DropTable(
635  name: "TestMerges");
636 
637  migrationBuilder.DropTable(
638  name: "Instances");
639 
640  migrationBuilder.DropTable(
641  name: "WatchdogReattachInformations");
642 
643  migrationBuilder.DropTable(
644  name: "ReattachInformations");
645 
646  migrationBuilder.DropTable(
647  name: "CompileJobs");
648 
649  migrationBuilder.DropTable(
650  name: "Jobs");
651 
652  migrationBuilder.DropTable(
653  name: "RevisionInformations");
654 
655  migrationBuilder.DropTable(
656  name: "Users");
657  }
658  }
659 }
ConfigurationRights
Rights for Models.ConfigurationFile
-
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
-
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
+Go to the documentation of this file.
1 using System;
2 using Microsoft.EntityFrameworkCore.Metadata;
3 using Microsoft.EntityFrameworkCore.Migrations;
4 
6 {
10  #pragma warning disable CA1506
11  public partial class MSInitialCreate : Migration
12  {
17  protected override void Up(MigrationBuilder migrationBuilder)
18  {
19  if (migrationBuilder == null)
20  throw new ArgumentNullException(nameof(migrationBuilder));
21 
22  migrationBuilder.CreateTable(
23  name: "Users",
24  columns: table => new
25  {
26  Id = table.Column<long>(nullable: false)
27  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
28  Enabled = table.Column<bool>(nullable: false),
29  CreatedAt = table.Column<DateTimeOffset>(nullable: false),
30  SystemIdentifier = table.Column<string>(nullable: true),
31  Name = table.Column<string>(nullable: false),
32  AdministrationRights = table.Column<decimal>(nullable: false),
33  InstanceManagerRights = table.Column<decimal>(nullable: false),
34  PasswordHash = table.Column<string>(nullable: true),
35  CreatedById = table.Column<long>(nullable: true),
36  CanonicalName = table.Column<string>(nullable: false),
37  LastPasswordUpdate = table.Column<DateTimeOffset>(nullable: true)
38  },
39  constraints: table =>
40  {
41  table.PrimaryKey("PK_Users", x => x.Id);
42  table.ForeignKey(
43  name: "FK_Users_Users_CreatedById",
44  column: x => x.CreatedById,
45  principalTable: "Users",
46  principalColumn: "Id",
47  onDelete: ReferentialAction.Restrict);
48  });
49 
50  migrationBuilder.CreateTable(
51  name: "ChatChannels",
52  columns: table => new
53  {
54  IrcChannel = table.Column<string>(nullable: true),
55  DiscordChannelId = table.Column<decimal>(nullable: true),
56  IsAdminChannel = table.Column<bool>(nullable: false),
57  IsWatchdogChannel = table.Column<bool>(nullable: false),
58  IsUpdatesChannel = table.Column<bool>(nullable: false),
59  Tag = table.Column<string>(nullable: true),
60  Id = table.Column<long>(nullable: false)
61  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
62  ChatSettingsId = table.Column<long>(nullable: false)
63  },
64  constraints: table =>
65  {
66  table.PrimaryKey("PK_ChatChannels", x => x.Id);
67  });
68 
69  migrationBuilder.CreateTable(
70  name: "ReattachInformations",
71  columns: table => new
72  {
73  ChatCommandsJson = table.Column<string>(nullable: false),
74  ChatChannelsJson = table.Column<string>(nullable: false),
75  ServerCommandsJson = table.Column<string>(nullable: false),
76  AccessIdentifier = table.Column<string>(nullable: false),
77  ProcessId = table.Column<int>(nullable: false),
78  IsPrimary = table.Column<bool>(nullable: false),
79  Port = table.Column<int>(nullable: false),
80  RebootState = table.Column<int>(nullable: false),
81  Id = table.Column<long>(nullable: false)
82  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
83  CompileJobId = table.Column<long>(nullable: true)
84  },
85  constraints: table =>
86  {
87  table.PrimaryKey("PK_ReattachInformations", x => x.Id);
88  });
89 
90  migrationBuilder.CreateTable(
91  name: "WatchdogReattachInformations",
92  columns: table => new
93  {
94  AlphaIsActive = table.Column<bool>(nullable: false),
95  Id = table.Column<long>(nullable: false)
96  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
97  AlphaId = table.Column<long>(nullable: true),
98  BravoId = table.Column<long>(nullable: true)
99  },
100  constraints: table =>
101  {
102  table.PrimaryKey("PK_WatchdogReattachInformations", x => x.Id);
103  table.ForeignKey(
104  name: "FK_WatchdogReattachInformations_ReattachInformations_AlphaId",
105  column: x => x.AlphaId,
106  principalTable: "ReattachInformations",
107  principalColumn: "Id",
108  onDelete: ReferentialAction.Restrict);
109  table.ForeignKey(
110  name: "FK_WatchdogReattachInformations_ReattachInformations_BravoId",
111  column: x => x.BravoId,
112  principalTable: "ReattachInformations",
113  principalColumn: "Id",
114  onDelete: ReferentialAction.Restrict);
115  });
116 
117  migrationBuilder.CreateTable(
118  name: "Instances",
119  columns: table => new
120  {
121  Id = table.Column<long>(nullable: false)
122  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
123  Name = table.Column<string>(nullable: false),
124  Path = table.Column<string>(nullable: false),
125  Online = table.Column<bool>(nullable: false),
126  ConfigurationType = table.Column<int>(nullable: false),
127  AutoUpdateInterval = table.Column<long>(nullable: false),
128  WatchdogReattachInformationId = table.Column<long>(nullable: true)
129  },
130  constraints: table =>
131  {
132  table.PrimaryKey("PK_Instances", x => x.Id);
133  table.ForeignKey(
134  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInformationId",
135  column: x => x.WatchdogReattachInformationId,
136  principalTable: "WatchdogReattachInformations",
137  principalColumn: "Id",
138  onDelete: ReferentialAction.Restrict);
139  });
140 
141  migrationBuilder.CreateTable(
142  name: "ChatBots",
143  columns: table => new
144  {
145  Id = table.Column<long>(nullable: false)
146  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
147  Name = table.Column<string>(nullable: false),
148  Enabled = table.Column<bool>(nullable: true),
149  Provider = table.Column<int>(nullable: true),
150  ConnectionString = table.Column<string>(nullable: false),
151  InstanceId = table.Column<long>(nullable: false)
152  },
153  constraints: table =>
154  {
155  table.PrimaryKey("PK_ChatBots", x => x.Id);
156  table.ForeignKey(
157  name: "FK_ChatBots_Instances_InstanceId",
158  column: x => x.InstanceId,
159  principalTable: "Instances",
160  principalColumn: "Id",
161  onDelete: ReferentialAction.Cascade);
162  });
163 
164  migrationBuilder.CreateTable(
165  name: "DreamDaemonSettings",
166  columns: table => new
167  {
168  AllowWebClient = table.Column<bool>(nullable: false),
169  SecurityLevel = table.Column<int>(nullable: false),
170  PrimaryPort = table.Column<int>(nullable: false),
171  SecondaryPort = table.Column<int>(nullable: false),
172  StartupTimeout = table.Column<long>(nullable: false),
173  AutoStart = table.Column<bool>(nullable: false),
174  SoftRestart = table.Column<bool>(nullable: false),
175  SoftShutdown = table.Column<bool>(nullable: false),
176  Id = table.Column<long>(nullable: false)
177  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
178  ProcessId = table.Column<int>(nullable: true),
179  AccessToken = table.Column<string>(nullable: true),
180  InstanceId = table.Column<long>(nullable: false)
181  },
182  constraints: table =>
183  {
184  table.PrimaryKey("PK_DreamDaemonSettings", x => x.Id);
185  table.ForeignKey(
186  name: "FK_DreamDaemonSettings_Instances_InstanceId",
187  column: x => x.InstanceId,
188  principalTable: "Instances",
189  principalColumn: "Id",
190  onDelete: ReferentialAction.Cascade);
191  });
192 
193  migrationBuilder.CreateTable(
194  name: "DreamMakerSettings",
195  columns: table => new
196  {
197  ProjectName = table.Column<string>(nullable: true),
198  ApiValidationPort = table.Column<int>(nullable: false),
199  Id = table.Column<long>(nullable: false)
200  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
201  InstanceId = table.Column<long>(nullable: false)
202  },
203  constraints: table =>
204  {
205  table.PrimaryKey("PK_DreamMakerSettings", x => x.Id);
206  table.ForeignKey(
207  name: "FK_DreamMakerSettings_Instances_InstanceId",
208  column: x => x.InstanceId,
209  principalTable: "Instances",
210  principalColumn: "Id",
211  onDelete: ReferentialAction.Cascade);
212  });
213 
214  migrationBuilder.CreateTable(
215  name: "InstanceUsers",
216  columns: table => new
217  {
218  UserId = table.Column<long>(nullable: false),
219  InstanceUserRights = table.Column<decimal>(nullable: false),
220  ByondRights = table.Column<decimal>(nullable: false),
221  DreamDaemonRights = table.Column<decimal>(nullable: false),
222  DreamMakerRights = table.Column<decimal>(nullable: false),
223  RepositoryRights = table.Column<decimal>(nullable: false),
224  ChatBotRights = table.Column<decimal>(nullable: false),
225  ConfigurationRights = table.Column<decimal>(nullable: false),
226  Id = table.Column<long>(nullable: false)
227  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
228  InstanceId = table.Column<long>(nullable: false)
229  },
230  constraints: table =>
231  {
232  table.PrimaryKey("PK_InstanceUsers", x => x.Id);
233  table.ForeignKey(
234  name: "FK_InstanceUsers_Instances_InstanceId",
235  column: x => x.InstanceId,
236  principalTable: "Instances",
237  principalColumn: "Id",
238  onDelete: ReferentialAction.Cascade);
239  table.ForeignKey(
240  name: "FK_InstanceUsers_Users_UserId",
241  column: x => x.UserId,
242  principalTable: "Users",
243  principalColumn: "Id",
244  onDelete: ReferentialAction.Cascade);
245  });
246 
247  migrationBuilder.CreateTable(
248  name: "Jobs",
249  columns: table => new
250  {
251  Id = table.Column<long>(nullable: false)
252  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
253  Description = table.Column<string>(nullable: false),
254  ExceptionDetails = table.Column<string>(nullable: true),
255  StartedAt = table.Column<DateTimeOffset>(nullable: false),
256  StoppedAt = table.Column<DateTimeOffset>(nullable: true),
257  Cancelled = table.Column<bool>(nullable: false),
258  CancelRightsType = table.Column<decimal>(nullable: true),
259  CancelRight = table.Column<decimal>(nullable: true),
260  StartedById = table.Column<long>(nullable: false),
261  CancelledById = table.Column<long>(nullable: true),
262  InstanceId = table.Column<long>(nullable: false)
263  },
264  constraints: table =>
265  {
266  table.PrimaryKey("PK_Jobs", x => x.Id);
267  table.ForeignKey(
268  name: "FK_Jobs_Users_CancelledById",
269  column: x => x.CancelledById,
270  principalTable: "Users",
271  principalColumn: "Id",
272  onDelete: ReferentialAction.Restrict);
273  table.ForeignKey(
274  name: "FK_Jobs_Instances_InstanceId",
275  column: x => x.InstanceId,
276  principalTable: "Instances",
277  principalColumn: "Id",
278  onDelete: ReferentialAction.Cascade);
279  table.ForeignKey(
280  name: "FK_Jobs_Users_StartedById",
281  column: x => x.StartedById,
282  principalTable: "Users",
283  principalColumn: "Id",
284  onDelete: ReferentialAction.Cascade);
285  });
286 
287  migrationBuilder.CreateTable(
288  name: "RepositorySettings",
289  columns: table => new
290  {
291  CommitterName = table.Column<string>(nullable: false),
292  CommitterEmail = table.Column<string>(nullable: false),
293  AccessUser = table.Column<string>(nullable: true),
294  AccessToken = table.Column<string>(nullable: true),
295  PushTestMergeCommits = table.Column<bool>(nullable: false),
296  ShowTestMergeCommitters = table.Column<bool>(nullable: false),
297  AutoUpdatesKeepTestMerges = table.Column<bool>(nullable: false),
298  AutoUpdatesSynchronize = table.Column<bool>(nullable: false),
299  Id = table.Column<long>(nullable: false)
300  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
301  InstanceId = table.Column<long>(nullable: false)
302  },
303  constraints: table =>
304  {
305  table.PrimaryKey("PK_RepositorySettings", x => x.Id);
306  table.ForeignKey(
307  name: "FK_RepositorySettings_Instances_InstanceId",
308  column: x => x.InstanceId,
309  principalTable: "Instances",
310  principalColumn: "Id",
311  onDelete: ReferentialAction.Cascade);
312  });
313 
314  migrationBuilder.CreateTable(
315  name: "RevisionInformations",
316  columns: table => new
317  {
318  CommitSha = table.Column<string>(maxLength: 40, nullable: false),
319  OriginCommitSha = table.Column<string>(maxLength: 40, nullable: false),
320  Id = table.Column<long>(nullable: false)
321  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
322  InstanceId = table.Column<long>(nullable: false)
323  },
324  constraints: table =>
325  {
326  table.PrimaryKey("PK_RevisionInformations", x => x.Id);
327  table.ForeignKey(
328  name: "FK_RevisionInformations_Instances_InstanceId",
329  column: x => x.InstanceId,
330  principalTable: "Instances",
331  principalColumn: "Id",
332  onDelete: ReferentialAction.Cascade);
333  });
334 
335  migrationBuilder.CreateTable(
336  name: "CompileJobs",
337  columns: table => new
338  {
339  Id = table.Column<long>(nullable: false)
340  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
341  DmeName = table.Column<string>(nullable: true),
342  Output = table.Column<string>(nullable: true),
343  DirectoryName = table.Column<Guid>(nullable: true),
344  JobId = table.Column<long>(nullable: true),
345  RevisionInformationId = table.Column<long>(nullable: false),
346  ByondVersion = table.Column<string>(nullable: false)
347  },
348  constraints: table =>
349  {
350  table.PrimaryKey("PK_CompileJobs", x => x.Id);
351  table.ForeignKey(
352  name: "FK_CompileJobs_Jobs_JobId",
353  column: x => x.JobId,
354  principalTable: "Jobs",
355  principalColumn: "Id",
356  onDelete: ReferentialAction.Restrict);
357  table.ForeignKey(
358  name: "FK_CompileJobs_RevisionInformations_RevisionInformationId",
359  column: x => x.RevisionInformationId,
360  principalTable: "RevisionInformations",
361  principalColumn: "Id",
362  onDelete: ReferentialAction.Cascade);
363  });
364 
365  migrationBuilder.CreateTable(
366  name: "TestMerges",
367  columns: table => new
368  {
369  Number = table.Column<int>(nullable: false),
370  PullRequestRevision = table.Column<string>(nullable: false),
371  Comment = table.Column<string>(nullable: true),
372  TitleAtMerge = table.Column<string>(nullable: false),
373  BodyAtMerge = table.Column<string>(nullable: false),
374  Url = table.Column<string>(nullable: false),
375  Author = table.Column<string>(nullable: false),
376  Id = table.Column<long>(nullable: false)
377  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
378  MergedAt = table.Column<DateTimeOffset>(nullable: false),
379  MergedById = table.Column<long>(nullable: false),
380  PrimaryRevisionInformationId = table.Column<long>(nullable: true)
381  },
382  constraints: table =>
383  {
384  table.PrimaryKey("PK_TestMerges", x => x.Id);
385  table.ForeignKey(
386  name: "FK_TestMerges_Users_MergedById",
387  column: x => x.MergedById,
388  principalTable: "Users",
389  principalColumn: "Id",
390  onDelete: ReferentialAction.Restrict);
391  table.ForeignKey(
392  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
393  column: x => x.PrimaryRevisionInformationId,
394  principalTable: "RevisionInformations",
395  principalColumn: "Id",
396  onDelete: ReferentialAction.SetNull);
397  });
398 
399  migrationBuilder.CreateTable(
400  name: "RevInfoTestMerges",
401  columns: table => new
402  {
403  Id = table.Column<long>(nullable: false)
404  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
405  TestMergeId = table.Column<long>(nullable: false),
406  RevisionInformationId = table.Column<long>(nullable: false)
407  },
408  constraints: table =>
409  {
410  table.PrimaryKey("PK_RevInfoTestMerges", x => x.Id);
411  table.ForeignKey(
412  name: "FK_RevInfoTestMerges_RevisionInformations_RevisionInformationId",
413  column: x => x.RevisionInformationId,
414  principalTable: "RevisionInformations",
415  principalColumn: "Id",
416  onDelete: ReferentialAction.Cascade);
417  table.ForeignKey(
418  name: "FK_RevInfoTestMerges_TestMerges_TestMergeId",
419  column: x => x.TestMergeId,
420  principalTable: "TestMerges",
421  principalColumn: "Id",
422  onDelete: ReferentialAction.Cascade);
423  });
424 
425  migrationBuilder.CreateIndex(
426  name: "IX_ChatBots_InstanceId",
427  table: "ChatBots",
428  column: "InstanceId");
429 
430  migrationBuilder.CreateIndex(
431  name: "IX_ChatBots_Name",
432  table: "ChatBots",
433  column: "Name",
434  unique: true);
435 
436  migrationBuilder.CreateIndex(
437  name: "IX_ChatChannels_ChatSettingsId_DiscordChannelId",
438  table: "ChatChannels",
439  columns: new[] { "ChatSettingsId", "DiscordChannelId" },
440  unique: true,
441  filter: "[DiscordChannelId] IS NOT NULL");
442 
443  migrationBuilder.CreateIndex(
444  name: "IX_ChatChannels_ChatSettingsId_IrcChannel",
445  table: "ChatChannels",
446  columns: new[] { "ChatSettingsId", "IrcChannel" },
447  unique: true,
448  filter: "[IrcChannel] IS NOT NULL");
449 
450  migrationBuilder.CreateIndex(
451  name: "IX_CompileJobs_DirectoryName",
452  table: "CompileJobs",
453  column: "DirectoryName");
454 
455  migrationBuilder.CreateIndex(
456  name: "IX_CompileJobs_JobId",
457  table: "CompileJobs",
458  column: "JobId");
459 
460  migrationBuilder.CreateIndex(
461  name: "IX_CompileJobs_RevisionInformationId",
462  table: "CompileJobs",
463  column: "RevisionInformationId");
464 
465  migrationBuilder.CreateIndex(
466  name: "IX_DreamDaemonSettings_InstanceId",
467  table: "DreamDaemonSettings",
468  column: "InstanceId",
469  unique: true);
470 
471  migrationBuilder.CreateIndex(
472  name: "IX_DreamMakerSettings_InstanceId",
473  table: "DreamMakerSettings",
474  column: "InstanceId",
475  unique: true);
476 
477  migrationBuilder.CreateIndex(
478  name: "IX_Instances_Path",
479  table: "Instances",
480  column: "Path",
481  unique: true);
482 
483  migrationBuilder.CreateIndex(
484  name: "IX_Instances_WatchdogReattachInformationId",
485  table: "Instances",
486  column: "WatchdogReattachInformationId");
487 
488  migrationBuilder.CreateIndex(
489  name: "IX_InstanceUsers_InstanceId",
490  table: "InstanceUsers",
491  column: "InstanceId");
492 
493  migrationBuilder.CreateIndex(
494  name: "IX_InstanceUsers_UserId_InstanceId",
495  table: "InstanceUsers",
496  columns: new[] { "UserId", "InstanceId" },
497  unique: true);
498 
499  migrationBuilder.CreateIndex(
500  name: "IX_Jobs_CancelledById",
501  table: "Jobs",
502  column: "CancelledById");
503 
504  migrationBuilder.CreateIndex(
505  name: "IX_Jobs_InstanceId",
506  table: "Jobs",
507  column: "InstanceId");
508 
509  migrationBuilder.CreateIndex(
510  name: "IX_Jobs_StartedById",
511  table: "Jobs",
512  column: "StartedById");
513 
514  migrationBuilder.CreateIndex(
515  name: "IX_ReattachInformations_CompileJobId",
516  table: "ReattachInformations",
517  column: "CompileJobId");
518 
519  migrationBuilder.CreateIndex(
520  name: "IX_RepositorySettings_InstanceId",
521  table: "RepositorySettings",
522  column: "InstanceId",
523  unique: true);
524 
525  migrationBuilder.CreateIndex(
526  name: "IX_RevInfoTestMerges_RevisionInformationId",
527  table: "RevInfoTestMerges",
528  column: "RevisionInformationId");
529 
530  migrationBuilder.CreateIndex(
531  name: "IX_RevInfoTestMerges_TestMergeId",
532  table: "RevInfoTestMerges",
533  column: "TestMergeId");
534 
535  migrationBuilder.CreateIndex(
536  name: "IX_RevisionInformations_CommitSha",
537  table: "RevisionInformations",
538  column: "CommitSha",
539  unique: true);
540 
541  migrationBuilder.CreateIndex(
542  name: "IX_RevisionInformations_InstanceId",
543  table: "RevisionInformations",
544  column: "InstanceId");
545 
546  migrationBuilder.CreateIndex(
547  name: "IX_TestMerges_MergedById",
548  table: "TestMerges",
549  column: "MergedById");
550 
551  migrationBuilder.CreateIndex(
552  name: "IX_TestMerges_PrimaryRevisionInformationId",
553  table: "TestMerges",
554  column: "PrimaryRevisionInformationId",
555  unique: true,
556  filter: "[PrimaryRevisionInformationId] IS NOT NULL");
557 
558  migrationBuilder.CreateIndex(
559  name: "IX_Users_CanonicalName",
560  table: "Users",
561  column: "CanonicalName",
562  unique: true);
563 
564  migrationBuilder.CreateIndex(
565  name: "IX_Users_CreatedById",
566  table: "Users",
567  column: "CreatedById");
568 
569  migrationBuilder.CreateIndex(
570  name: "IX_WatchdogReattachInformations_AlphaId",
571  table: "WatchdogReattachInformations",
572  column: "AlphaId");
573 
574  migrationBuilder.CreateIndex(
575  name: "IX_WatchdogReattachInformations_BravoId",
576  table: "WatchdogReattachInformations",
577  column: "BravoId");
578 
579  migrationBuilder.AddForeignKey(
580  name: "FK_ChatChannels_ChatBots_ChatSettingsId",
581  table: "ChatChannels",
582  column: "ChatSettingsId",
583  principalTable: "ChatBots",
584  principalColumn: "Id",
585  onDelete: ReferentialAction.Cascade);
586 
587  migrationBuilder.AddForeignKey(
588  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
589  table: "ReattachInformations",
590  column: "CompileJobId",
591  principalTable: "CompileJobs",
592  principalColumn: "Id",
593  onDelete: ReferentialAction.Restrict);
594  }
595 
600  protected override void Down(MigrationBuilder migrationBuilder)
601  {
602  if (migrationBuilder == null)
603  throw new ArgumentNullException(nameof(migrationBuilder));
604 
605  migrationBuilder.DropForeignKey(
606  name: "FK_Jobs_Instances_InstanceId",
607  table: "Jobs");
608 
609  migrationBuilder.DropForeignKey(
610  name: "FK_RevisionInformations_Instances_InstanceId",
611  table: "RevisionInformations");
612 
613  migrationBuilder.DropTable(
614  name: "ChatChannels");
615 
616  migrationBuilder.DropTable(
617  name: "DreamDaemonSettings");
618 
619  migrationBuilder.DropTable(
620  name: "DreamMakerSettings");
621 
622  migrationBuilder.DropTable(
623  name: "InstanceUsers");
624 
625  migrationBuilder.DropTable(
626  name: "RepositorySettings");
627 
628  migrationBuilder.DropTable(
629  name: "RevInfoTestMerges");
630 
631  migrationBuilder.DropTable(
632  name: "ChatBots");
633 
634  migrationBuilder.DropTable(
635  name: "TestMerges");
636 
637  migrationBuilder.DropTable(
638  name: "Instances");
639 
640  migrationBuilder.DropTable(
641  name: "WatchdogReattachInformations");
642 
643  migrationBuilder.DropTable(
644  name: "ReattachInformations");
645 
646  migrationBuilder.DropTable(
647  name: "CompileJobs");
648 
649  migrationBuilder.DropTable(
650  name: "Jobs");
651 
652  migrationBuilder.DropTable(
653  name: "RevisionInformations");
654 
655  migrationBuilder.DropTable(
656  name: "Users");
657  }
658  }
659 }
ConfigurationRights
Rights for Models.ConfigurationFile
ByondRights
Rights for Models.Byond
Definition: ByondRights.cs:9
InstanceUserRights
Rights for an Models.Instance
-
AdministrationRights
Rights for Models.Administration
ConfigurationType
The type of configuration allowed on an Instance
+
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
DreamDaemonRights
Rights for Models.DreamDaemon
InstanceManagerRights
Rights for managing Models.Instances
DreamMakerRights
Rights for Models.DreamMaker
+
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
+
RepositoryRights
Rights for a Models.Repository
- +
ChatBotRights
Rights for Models.ChatBot
Definition: ChatBotRights.cs:9
RebootState
Represents the action to take when /world/Reboot() is called
Definition: RebootState.cs:6
diff --git a/20180906143029___m_y_initial_create_8_designer_8cs.html b/20180906143029___m_y_initial_create_8_designer_8cs.html index 8bc67d7463..e3f30acb17 100644 --- a/20180906143029___m_y_initial_create_8_designer_8cs.html +++ b/20180906143029___m_y_initial_create_8_designer_8cs.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180906143029_MYInitialCreate.Designer.cs File Reference +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180906143029_MYInitialCreate.Designer.cs File Reference @@ -63,7 +63,7 @@ $(function() {
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MYInitialCreate
 The initial database migration for MySQL/MariaDB More...
class  Tgstation.Server.Host.Database.Migrations.MYInitialCreate
 The initial database migration for MySQL/MariaDB More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180906143029___m_y_initial_create_8_designer_8cs_source.html b/20180906143029___m_y_initial_create_8_designer_8cs_source.html index 71a523b899..23bed3a5d4 100644 --- a/20180906143029___m_y_initial_create_8_designer_8cs_source.html +++ b/20180906143029___m_y_initial_create_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180906143029_MYInitialCreate.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180906143029_MYInitialCreate.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20180906143029_MYInitialCreate.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
7 
9 {
11  [Migration("20180906143029_MYInitialCreate")]
12  partial class MYInitialCreate
13  {
18  protected override void BuildTargetModel(ModelBuilder modelBuilder)
19  {
20 #pragma warning disable 612, 618
21  modelBuilder
22  .HasAnnotation("ProductVersion", "2.1.2-rtm-30932")
23  .HasAnnotation("Relational:MaxIdentifierLength", 64);
24 
25  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
26  {
27  b.Property<long>("Id")
28  .ValueGeneratedOnAdd();
29 
30  b.Property<string>("ConnectionString")
31  .IsRequired();
32 
33  b.Property<bool?>("Enabled");
34 
35  b.Property<long>("InstanceId");
36 
37  b.Property<string>("Name")
38  .IsRequired();
39 
40  b.Property<int?>("Provider");
41 
42  b.HasKey("Id");
43 
44  b.HasIndex("InstanceId");
45 
46  b.HasIndex("Name")
47  .IsUnique();
48 
49  b.ToTable("ChatBots");
50  });
51 
52  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
53  {
54  b.Property<long>("Id")
55  .ValueGeneratedOnAdd();
56 
57  b.Property<long>("ChatSettingsId");
58 
59  b.Property<ulong?>("DiscordChannelId");
60 
61  b.Property<string>("IrcChannel");
62 
63  b.Property<bool?>("IsAdminChannel")
64  .IsRequired();
65 
66  b.Property<bool?>("IsUpdatesChannel")
67  .IsRequired();
68 
69  b.Property<bool?>("IsWatchdogChannel")
70  .IsRequired();
71 
72  b.Property<string>("Tag");
73 
74  b.HasKey("Id");
75 
76  b.HasIndex("ChatSettingsId", "DiscordChannelId")
77  .IsUnique();
78 
79  b.HasIndex("ChatSettingsId", "IrcChannel")
80  .IsUnique();
81 
82  b.ToTable("ChatChannels");
83  });
84 
85  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
86  {
87  b.Property<long>("Id")
88  .ValueGeneratedOnAdd();
89 
90  b.Property<string>("ByondVersion")
91  .IsRequired();
92 
93  b.Property<Guid?>("DirectoryName");
94 
95  b.Property<string>("DmeName");
96 
97  b.Property<long?>("JobId");
98 
99  b.Property<string>("Output");
100 
101  b.Property<long>("RevisionInformationId");
102 
103  b.HasKey("Id");
104 
105  b.HasIndex("DirectoryName");
106 
107  b.HasIndex("JobId");
108 
109  b.HasIndex("RevisionInformationId");
110 
111  b.ToTable("CompileJobs");
112  });
113 
114  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
115  {
116  b.Property<long>("Id")
117  .ValueGeneratedOnAdd();
118 
119  b.Property<string>("AccessToken");
120 
121  b.Property<bool?>("AllowWebClient")
122  .IsRequired();
123 
124  b.Property<bool?>("AutoStart")
125  .IsRequired();
126 
127  b.Property<long>("InstanceId");
128 
129  b.Property<ushort?>("PrimaryPort")
130  .IsRequired();
131 
132  b.Property<int?>("ProcessId");
133 
134  b.Property<ushort?>("SecondaryPort")
135  .IsRequired();
136 
137  b.Property<int>("SecurityLevel");
138 
139  b.Property<bool?>("SoftRestart")
140  .IsRequired();
141 
142  b.Property<bool?>("SoftShutdown")
143  .IsRequired();
144 
145  b.Property<uint?>("StartupTimeout")
146  .IsRequired();
147 
148  b.HasKey("Id");
149 
150  b.HasIndex("InstanceId")
151  .IsUnique();
152 
153  b.ToTable("DreamDaemonSettings");
154  });
155 
156  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
157  {
158  b.Property<long>("Id")
159  .ValueGeneratedOnAdd();
160 
161  b.Property<ushort?>("ApiValidationPort")
162  .IsRequired();
163 
164  b.Property<long>("InstanceId");
165 
166  b.Property<string>("ProjectName");
167 
168  b.HasKey("Id");
169 
170  b.HasIndex("InstanceId")
171  .IsUnique();
172 
173  b.ToTable("DreamMakerSettings");
174  });
175 
176  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
177  {
178  b.Property<long>("Id")
179  .ValueGeneratedOnAdd();
180 
181  b.Property<uint?>("AutoUpdateInterval")
182  .IsRequired();
183 
184  b.Property<int>("ConfigurationType");
185 
186  b.Property<string>("Name")
187  .IsRequired();
188 
189  b.Property<bool?>("Online")
190  .IsRequired();
191 
192  b.Property<string>("Path")
193  .IsRequired();
194 
195  b.Property<long?>("WatchdogReattachInformationId");
196 
197  b.HasKey("Id");
198 
199  b.HasIndex("Path")
200  .IsUnique();
201 
202  b.HasIndex("WatchdogReattachInformationId");
203 
204  b.ToTable("Instances");
205  });
206 
207  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
208  {
209  b.Property<long>("Id")
210  .ValueGeneratedOnAdd();
211 
212  b.Property<ulong>("ByondRights");
213 
214  b.Property<ulong>("ChatBotRights");
215 
216  b.Property<ulong>("ConfigurationRights");
217 
218  b.Property<ulong>("DreamDaemonRights");
219 
220  b.Property<ulong>("DreamMakerRights");
221 
222  b.Property<long>("InstanceId");
223 
224  b.Property<ulong>("InstanceUserRights");
225 
226  b.Property<ulong>("RepositoryRights");
227 
228  b.Property<long?>("UserId")
229  .IsRequired();
230 
231  b.HasKey("Id");
232 
233  b.HasIndex("InstanceId");
234 
235  b.HasIndex("UserId", "InstanceId")
236  .IsUnique();
237 
238  b.ToTable("InstanceUsers");
239  });
240 
241  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
242  {
243  b.Property<long>("Id")
244  .ValueGeneratedOnAdd();
245 
246  b.Property<ulong?>("CancelRight");
247 
248  b.Property<ulong?>("CancelRightsType");
249 
250  b.Property<bool?>("Cancelled")
251  .IsRequired();
252 
253  b.Property<long?>("CancelledById");
254 
255  b.Property<string>("Description")
256  .IsRequired();
257 
258  b.Property<string>("ExceptionDetails");
259 
260  b.Property<long>("InstanceId");
261 
262  b.Property<DateTimeOffset?>("StartedAt")
263  .IsRequired();
264 
265  b.Property<long>("StartedById");
266 
267  b.Property<DateTimeOffset?>("StoppedAt");
268 
269  b.HasKey("Id");
270 
271  b.HasIndex("CancelledById");
272 
273  b.HasIndex("InstanceId");
274 
275  b.HasIndex("StartedById");
276 
277  b.ToTable("Jobs");
278  });
279 
280  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
281  {
282  b.Property<long>("Id")
283  .ValueGeneratedOnAdd();
284 
285  b.Property<string>("AccessIdentifier")
286  .IsRequired();
287 
288  b.Property<string>("ChatChannelsJson")
289  .IsRequired();
290 
291  b.Property<string>("ChatCommandsJson")
292  .IsRequired();
293 
294  b.Property<long?>("CompileJobId");
295 
296  b.Property<bool>("IsPrimary");
297 
298  b.Property<ushort>("Port");
299 
300  b.Property<int>("ProcessId");
301 
302  b.Property<int>("RebootState");
303 
304  b.Property<string>("ServerCommandsJson")
305  .IsRequired();
306 
307  b.HasKey("Id");
308 
309  b.HasIndex("CompileJobId");
310 
311  b.ToTable("ReattachInformations");
312  });
313 
314  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
315  {
316  b.Property<long>("Id")
317  .ValueGeneratedOnAdd();
318 
319  b.Property<string>("AccessToken");
320 
321  b.Property<string>("AccessUser");
322 
323  b.Property<bool?>("AutoUpdatesKeepTestMerges")
324  .IsRequired();
325 
326  b.Property<bool?>("AutoUpdatesSynchronize")
327  .IsRequired();
328 
329  b.Property<string>("CommitterEmail")
330  .IsRequired();
331 
332  b.Property<string>("CommitterName")
333  .IsRequired();
334 
335  b.Property<long>("InstanceId");
336 
337  b.Property<bool?>("PushTestMergeCommits")
338  .IsRequired();
339 
340  b.Property<bool?>("ShowTestMergeCommitters")
341  .IsRequired();
342 
343  b.HasKey("Id");
344 
345  b.HasIndex("InstanceId")
346  .IsUnique();
347 
348  b.ToTable("RepositorySettings");
349  });
350 
351  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
352  {
353  b.Property<long>("Id")
354  .ValueGeneratedOnAdd();
355 
356  b.Property<long>("RevisionInformationId");
357 
358  b.Property<long>("TestMergeId");
359 
360  b.HasKey("Id");
361 
362  b.HasIndex("RevisionInformationId");
363 
364  b.HasIndex("TestMergeId");
365 
366  b.ToTable("RevInfoTestMerges");
367  });
368 
369  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
370  {
371  b.Property<long>("Id")
372  .ValueGeneratedOnAdd();
373 
374  b.Property<string>("CommitSha")
375  .IsRequired()
376  .HasMaxLength(40);
377 
378  b.Property<long>("InstanceId");
379 
380  b.Property<string>("OriginCommitSha")
381  .IsRequired()
382  .HasMaxLength(40);
383 
384  b.HasKey("Id");
385 
386  b.HasIndex("CommitSha")
387  .IsUnique();
388 
389  b.HasIndex("InstanceId");
390 
391  b.ToTable("RevisionInformations");
392  });
393 
394  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
395  {
396  b.Property<long>("Id")
397  .ValueGeneratedOnAdd();
398 
399  b.Property<string>("Author")
400  .IsRequired();
401 
402  b.Property<string>("BodyAtMerge")
403  .IsRequired();
404 
405  b.Property<string>("Comment");
406 
407  b.Property<DateTimeOffset>("MergedAt");
408 
409  b.Property<long>("MergedById");
410 
411  b.Property<int?>("Number")
412  .IsRequired();
413 
414  b.Property<long?>("PrimaryRevisionInformationId");
415 
416  b.Property<string>("PullRequestRevision")
417  .IsRequired();
418 
419  b.Property<string>("TitleAtMerge")
420  .IsRequired();
421 
422  b.Property<string>("Url")
423  .IsRequired();
424 
425  b.HasKey("Id");
426 
427  b.HasIndex("MergedById");
428 
429  b.HasIndex("PrimaryRevisionInformationId")
430  .IsUnique();
431 
432  b.ToTable("TestMerges");
433  });
434 
435  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
436  {
437  b.Property<long>("Id")
438  .ValueGeneratedOnAdd();
439 
440  b.Property<ulong>("AdministrationRights");
441 
442  b.Property<string>("CanonicalName")
443  .IsRequired();
444 
445  b.Property<DateTimeOffset?>("CreatedAt")
446  .IsRequired();
447 
448  b.Property<long?>("CreatedById");
449 
450  b.Property<bool?>("Enabled")
451  .IsRequired();
452 
453  b.Property<ulong>("InstanceManagerRights");
454 
455  b.Property<DateTimeOffset?>("LastPasswordUpdate");
456 
457  b.Property<string>("Name")
458  .IsRequired();
459 
460  b.Property<string>("PasswordHash");
461 
462  b.Property<string>("SystemIdentifier");
463 
464  b.HasKey("Id");
465 
466  b.HasIndex("CanonicalName")
467  .IsUnique();
468 
469  b.HasIndex("CreatedById");
470 
471  b.ToTable("Users");
472  });
473 
474  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
475  {
476  b.Property<long>("Id")
477  .ValueGeneratedOnAdd();
478 
479  b.Property<long?>("AlphaId");
480 
481  b.Property<bool>("AlphaIsActive");
482 
483  b.Property<long?>("BravoId");
484 
485  b.HasKey("Id");
486 
487  b.HasIndex("AlphaId");
488 
489  b.HasIndex("BravoId");
490 
491  b.ToTable("WatchdogReattachInformations");
492  });
493 
494  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
495  {
496  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
497  .WithMany("ChatSettings")
498  .HasForeignKey("InstanceId")
499  .OnDelete(DeleteBehavior.Cascade);
500  });
501 
502  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
503  {
504  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
505  .WithMany("Channels")
506  .HasForeignKey("ChatSettingsId")
507  .OnDelete(DeleteBehavior.Cascade);
508  });
509 
510  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
511  {
512  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
513  .WithMany()
514  .HasForeignKey("JobId");
515 
516  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
517  .WithMany("CompileJobs")
518  .HasForeignKey("RevisionInformationId")
519  .OnDelete(DeleteBehavior.Cascade);
520  });
521 
522  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
523  {
524  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
525  .WithOne("DreamDaemonSettings")
526  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
527  .OnDelete(DeleteBehavior.Cascade);
528  });
529 
530  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
531  {
532  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
533  .WithOne("DreamMakerSettings")
534  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
535  .OnDelete(DeleteBehavior.Cascade);
536  });
537 
538  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
539  {
540  b.HasOne("Tgstation.Server.Host.Models.WatchdogReattachInformation", "WatchdogReattachInformation")
541  .WithMany()
542  .HasForeignKey("WatchdogReattachInformationId");
543  });
544 
545  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
546  {
547  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
548  .WithMany("InstanceUsers")
549  .HasForeignKey("InstanceId")
550  .OnDelete(DeleteBehavior.Cascade);
551 
552  b.HasOne("Tgstation.Server.Host.Models.User")
553  .WithMany("InstanceUsers")
554  .HasForeignKey("UserId")
555  .OnDelete(DeleteBehavior.Cascade);
556  });
557 
558  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
559  {
560  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
561  .WithMany()
562  .HasForeignKey("CancelledById");
563 
564  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
565  .WithMany("Jobs")
566  .HasForeignKey("InstanceId")
567  .OnDelete(DeleteBehavior.Cascade);
568 
569  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
570  .WithMany()
571  .HasForeignKey("StartedById")
572  .OnDelete(DeleteBehavior.Cascade);
573  });
574 
575  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
576  {
577  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
578  .WithMany()
579  .HasForeignKey("CompileJobId");
580  });
581 
582  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
583  {
584  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
585  .WithOne("RepositorySettings")
586  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
587  .OnDelete(DeleteBehavior.Cascade);
588  });
589 
590  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
591  {
592  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
593  .WithMany("ActiveTestMerges")
594  .HasForeignKey("RevisionInformationId")
595  .OnDelete(DeleteBehavior.Cascade);
596 
597  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
598  .WithMany("RevisonInformations")
599  .HasForeignKey("TestMergeId")
600  .OnDelete(DeleteBehavior.Cascade);
601  });
602 
603  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
604  {
605  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
606  .WithMany("RevisionInformations")
607  .HasForeignKey("InstanceId")
608  .OnDelete(DeleteBehavior.Cascade);
609  });
610 
611  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
612  {
613  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
614  .WithMany("TestMerges")
615  .HasForeignKey("MergedById")
616  .OnDelete(DeleteBehavior.Restrict);
617 
618  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
619  .WithOne("PrimaryTestMerge")
620  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
621  .OnDelete(DeleteBehavior.SetNull);
622  });
623 
624  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
625  {
626  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
627  .WithMany("CreatedUsers")
628  .HasForeignKey("CreatedById");
629  });
630 
631  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
632  {
633  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
634  .WithMany()
635  .HasForeignKey("AlphaId");
636 
637  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
638  .WithMany()
639  .HasForeignKey("BravoId");
640  });
641 #pragma warning restore 612, 618
642  }
643  }
644 }
- +Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
6 
8 {
9  [DbContext(typeof(MySqlDatabaseContext))]
10  [Migration("20180906143029_MYInitialCreate")]
11  partial class MYInitialCreate
12  {
17  protected override void BuildTargetModel(ModelBuilder modelBuilder)
18  {
19 #pragma warning disable 612, 618
20  modelBuilder
21  .HasAnnotation("ProductVersion", "2.1.2-rtm-30932")
22  .HasAnnotation("Relational:MaxIdentifierLength", 64);
23 
24  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
25  {
26  b.Property<long>("Id")
27  .ValueGeneratedOnAdd();
28 
29  b.Property<string>("ConnectionString")
30  .IsRequired();
31 
32  b.Property<bool?>("Enabled");
33 
34  b.Property<long>("InstanceId");
35 
36  b.Property<string>("Name")
37  .IsRequired();
38 
39  b.Property<int?>("Provider");
40 
41  b.HasKey("Id");
42 
43  b.HasIndex("InstanceId");
44 
45  b.HasIndex("Name")
46  .IsUnique();
47 
48  b.ToTable("ChatBots");
49  });
50 
51  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
52  {
53  b.Property<long>("Id")
54  .ValueGeneratedOnAdd();
55 
56  b.Property<long>("ChatSettingsId");
57 
58  b.Property<ulong?>("DiscordChannelId");
59 
60  b.Property<string>("IrcChannel");
61 
62  b.Property<bool?>("IsAdminChannel")
63  .IsRequired();
64 
65  b.Property<bool?>("IsUpdatesChannel")
66  .IsRequired();
67 
68  b.Property<bool?>("IsWatchdogChannel")
69  .IsRequired();
70 
71  b.Property<string>("Tag");
72 
73  b.HasKey("Id");
74 
75  b.HasIndex("ChatSettingsId", "DiscordChannelId")
76  .IsUnique();
77 
78  b.HasIndex("ChatSettingsId", "IrcChannel")
79  .IsUnique();
80 
81  b.ToTable("ChatChannels");
82  });
83 
84  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
85  {
86  b.Property<long>("Id")
87  .ValueGeneratedOnAdd();
88 
89  b.Property<string>("ByondVersion")
90  .IsRequired();
91 
92  b.Property<Guid?>("DirectoryName");
93 
94  b.Property<string>("DmeName");
95 
96  b.Property<long?>("JobId");
97 
98  b.Property<string>("Output");
99 
100  b.Property<long>("RevisionInformationId");
101 
102  b.HasKey("Id");
103 
104  b.HasIndex("DirectoryName");
105 
106  b.HasIndex("JobId");
107 
108  b.HasIndex("RevisionInformationId");
109 
110  b.ToTable("CompileJobs");
111  });
112 
113  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
114  {
115  b.Property<long>("Id")
116  .ValueGeneratedOnAdd();
117 
118  b.Property<string>("AccessToken");
119 
120  b.Property<bool?>("AllowWebClient")
121  .IsRequired();
122 
123  b.Property<bool?>("AutoStart")
124  .IsRequired();
125 
126  b.Property<long>("InstanceId");
127 
128  b.Property<ushort?>("PrimaryPort")
129  .IsRequired();
130 
131  b.Property<int?>("ProcessId");
132 
133  b.Property<ushort?>("SecondaryPort")
134  .IsRequired();
135 
136  b.Property<int>("SecurityLevel");
137 
138  b.Property<bool?>("SoftRestart")
139  .IsRequired();
140 
141  b.Property<bool?>("SoftShutdown")
142  .IsRequired();
143 
144  b.Property<uint?>("StartupTimeout")
145  .IsRequired();
146 
147  b.HasKey("Id");
148 
149  b.HasIndex("InstanceId")
150  .IsUnique();
151 
152  b.ToTable("DreamDaemonSettings");
153  });
154 
155  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
156  {
157  b.Property<long>("Id")
158  .ValueGeneratedOnAdd();
159 
160  b.Property<ushort?>("ApiValidationPort")
161  .IsRequired();
162 
163  b.Property<long>("InstanceId");
164 
165  b.Property<string>("ProjectName");
166 
167  b.HasKey("Id");
168 
169  b.HasIndex("InstanceId")
170  .IsUnique();
171 
172  b.ToTable("DreamMakerSettings");
173  });
174 
175  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
176  {
177  b.Property<long>("Id")
178  .ValueGeneratedOnAdd();
179 
180  b.Property<uint?>("AutoUpdateInterval")
181  .IsRequired();
182 
183  b.Property<int>("ConfigurationType");
184 
185  b.Property<string>("Name")
186  .IsRequired();
187 
188  b.Property<bool?>("Online")
189  .IsRequired();
190 
191  b.Property<string>("Path")
192  .IsRequired();
193 
194  b.Property<long?>("WatchdogReattachInformationId");
195 
196  b.HasKey("Id");
197 
198  b.HasIndex("Path")
199  .IsUnique();
200 
201  b.HasIndex("WatchdogReattachInformationId");
202 
203  b.ToTable("Instances");
204  });
205 
206  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
207  {
208  b.Property<long>("Id")
209  .ValueGeneratedOnAdd();
210 
211  b.Property<ulong>("ByondRights");
212 
213  b.Property<ulong>("ChatBotRights");
214 
215  b.Property<ulong>("ConfigurationRights");
216 
217  b.Property<ulong>("DreamDaemonRights");
218 
219  b.Property<ulong>("DreamMakerRights");
220 
221  b.Property<long>("InstanceId");
222 
223  b.Property<ulong>("InstanceUserRights");
224 
225  b.Property<ulong>("RepositoryRights");
226 
227  b.Property<long?>("UserId")
228  .IsRequired();
229 
230  b.HasKey("Id");
231 
232  b.HasIndex("InstanceId");
233 
234  b.HasIndex("UserId", "InstanceId")
235  .IsUnique();
236 
237  b.ToTable("InstanceUsers");
238  });
239 
240  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
241  {
242  b.Property<long>("Id")
243  .ValueGeneratedOnAdd();
244 
245  b.Property<ulong?>("CancelRight");
246 
247  b.Property<ulong?>("CancelRightsType");
248 
249  b.Property<bool?>("Cancelled")
250  .IsRequired();
251 
252  b.Property<long?>("CancelledById");
253 
254  b.Property<string>("Description")
255  .IsRequired();
256 
257  b.Property<string>("ExceptionDetails");
258 
259  b.Property<long>("InstanceId");
260 
261  b.Property<DateTimeOffset?>("StartedAt")
262  .IsRequired();
263 
264  b.Property<long>("StartedById");
265 
266  b.Property<DateTimeOffset?>("StoppedAt");
267 
268  b.HasKey("Id");
269 
270  b.HasIndex("CancelledById");
271 
272  b.HasIndex("InstanceId");
273 
274  b.HasIndex("StartedById");
275 
276  b.ToTable("Jobs");
277  });
278 
279  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
280  {
281  b.Property<long>("Id")
282  .ValueGeneratedOnAdd();
283 
284  b.Property<string>("AccessIdentifier")
285  .IsRequired();
286 
287  b.Property<string>("ChatChannelsJson")
288  .IsRequired();
289 
290  b.Property<string>("ChatCommandsJson")
291  .IsRequired();
292 
293  b.Property<long?>("CompileJobId");
294 
295  b.Property<bool>("IsPrimary");
296 
297  b.Property<ushort>("Port");
298 
299  b.Property<int>("ProcessId");
300 
301  b.Property<int>("RebootState");
302 
303  b.Property<string>("ServerCommandsJson")
304  .IsRequired();
305 
306  b.HasKey("Id");
307 
308  b.HasIndex("CompileJobId");
309 
310  b.ToTable("ReattachInformations");
311  });
312 
313  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
314  {
315  b.Property<long>("Id")
316  .ValueGeneratedOnAdd();
317 
318  b.Property<string>("AccessToken");
319 
320  b.Property<string>("AccessUser");
321 
322  b.Property<bool?>("AutoUpdatesKeepTestMerges")
323  .IsRequired();
324 
325  b.Property<bool?>("AutoUpdatesSynchronize")
326  .IsRequired();
327 
328  b.Property<string>("CommitterEmail")
329  .IsRequired();
330 
331  b.Property<string>("CommitterName")
332  .IsRequired();
333 
334  b.Property<long>("InstanceId");
335 
336  b.Property<bool?>("PushTestMergeCommits")
337  .IsRequired();
338 
339  b.Property<bool?>("ShowTestMergeCommitters")
340  .IsRequired();
341 
342  b.HasKey("Id");
343 
344  b.HasIndex("InstanceId")
345  .IsUnique();
346 
347  b.ToTable("RepositorySettings");
348  });
349 
350  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
351  {
352  b.Property<long>("Id")
353  .ValueGeneratedOnAdd();
354 
355  b.Property<long>("RevisionInformationId");
356 
357  b.Property<long>("TestMergeId");
358 
359  b.HasKey("Id");
360 
361  b.HasIndex("RevisionInformationId");
362 
363  b.HasIndex("TestMergeId");
364 
365  b.ToTable("RevInfoTestMerges");
366  });
367 
368  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
369  {
370  b.Property<long>("Id")
371  .ValueGeneratedOnAdd();
372 
373  b.Property<string>("CommitSha")
374  .IsRequired()
375  .HasMaxLength(40);
376 
377  b.Property<long>("InstanceId");
378 
379  b.Property<string>("OriginCommitSha")
380  .IsRequired()
381  .HasMaxLength(40);
382 
383  b.HasKey("Id");
384 
385  b.HasIndex("CommitSha")
386  .IsUnique();
387 
388  b.HasIndex("InstanceId");
389 
390  b.ToTable("RevisionInformations");
391  });
392 
393  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
394  {
395  b.Property<long>("Id")
396  .ValueGeneratedOnAdd();
397 
398  b.Property<string>("Author")
399  .IsRequired();
400 
401  b.Property<string>("BodyAtMerge")
402  .IsRequired();
403 
404  b.Property<string>("Comment");
405 
406  b.Property<DateTimeOffset>("MergedAt");
407 
408  b.Property<long>("MergedById");
409 
410  b.Property<int?>("Number")
411  .IsRequired();
412 
413  b.Property<long?>("PrimaryRevisionInformationId");
414 
415  b.Property<string>("PullRequestRevision")
416  .IsRequired();
417 
418  b.Property<string>("TitleAtMerge")
419  .IsRequired();
420 
421  b.Property<string>("Url")
422  .IsRequired();
423 
424  b.HasKey("Id");
425 
426  b.HasIndex("MergedById");
427 
428  b.HasIndex("PrimaryRevisionInformationId")
429  .IsUnique();
430 
431  b.ToTable("TestMerges");
432  });
433 
434  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
435  {
436  b.Property<long>("Id")
437  .ValueGeneratedOnAdd();
438 
439  b.Property<ulong>("AdministrationRights");
440 
441  b.Property<string>("CanonicalName")
442  .IsRequired();
443 
444  b.Property<DateTimeOffset?>("CreatedAt")
445  .IsRequired();
446 
447  b.Property<long?>("CreatedById");
448 
449  b.Property<bool?>("Enabled")
450  .IsRequired();
451 
452  b.Property<ulong>("InstanceManagerRights");
453 
454  b.Property<DateTimeOffset?>("LastPasswordUpdate");
455 
456  b.Property<string>("Name")
457  .IsRequired();
458 
459  b.Property<string>("PasswordHash");
460 
461  b.Property<string>("SystemIdentifier");
462 
463  b.HasKey("Id");
464 
465  b.HasIndex("CanonicalName")
466  .IsUnique();
467 
468  b.HasIndex("CreatedById");
469 
470  b.ToTable("Users");
471  });
472 
473  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
474  {
475  b.Property<long>("Id")
476  .ValueGeneratedOnAdd();
477 
478  b.Property<long?>("AlphaId");
479 
480  b.Property<bool>("AlphaIsActive");
481 
482  b.Property<long?>("BravoId");
483 
484  b.HasKey("Id");
485 
486  b.HasIndex("AlphaId");
487 
488  b.HasIndex("BravoId");
489 
490  b.ToTable("WatchdogReattachInformations");
491  });
492 
493  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
494  {
495  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
496  .WithMany("ChatSettings")
497  .HasForeignKey("InstanceId")
498  .OnDelete(DeleteBehavior.Cascade);
499  });
500 
501  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
502  {
503  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
504  .WithMany("Channels")
505  .HasForeignKey("ChatSettingsId")
506  .OnDelete(DeleteBehavior.Cascade);
507  });
508 
509  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
510  {
511  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
512  .WithMany()
513  .HasForeignKey("JobId");
514 
515  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
516  .WithMany("CompileJobs")
517  .HasForeignKey("RevisionInformationId")
518  .OnDelete(DeleteBehavior.Cascade);
519  });
520 
521  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
522  {
523  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
524  .WithOne("DreamDaemonSettings")
525  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
526  .OnDelete(DeleteBehavior.Cascade);
527  });
528 
529  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
530  {
531  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
532  .WithOne("DreamMakerSettings")
533  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
534  .OnDelete(DeleteBehavior.Cascade);
535  });
536 
537  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
538  {
539  b.HasOne("Tgstation.Server.Host.Models.WatchdogReattachInformation", "WatchdogReattachInformation")
540  .WithMany()
541  .HasForeignKey("WatchdogReattachInformationId");
542  });
543 
544  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
545  {
546  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
547  .WithMany("InstanceUsers")
548  .HasForeignKey("InstanceId")
549  .OnDelete(DeleteBehavior.Cascade);
550 
551  b.HasOne("Tgstation.Server.Host.Models.User")
552  .WithMany("InstanceUsers")
553  .HasForeignKey("UserId")
554  .OnDelete(DeleteBehavior.Cascade);
555  });
556 
557  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
558  {
559  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
560  .WithMany()
561  .HasForeignKey("CancelledById");
562 
563  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
564  .WithMany("Jobs")
565  .HasForeignKey("InstanceId")
566  .OnDelete(DeleteBehavior.Cascade);
567 
568  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
569  .WithMany()
570  .HasForeignKey("StartedById")
571  .OnDelete(DeleteBehavior.Cascade);
572  });
573 
574  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
575  {
576  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
577  .WithMany()
578  .HasForeignKey("CompileJobId");
579  });
580 
581  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
582  {
583  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
584  .WithOne("RepositorySettings")
585  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
586  .OnDelete(DeleteBehavior.Cascade);
587  });
588 
589  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
590  {
591  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
592  .WithMany("ActiveTestMerges")
593  .HasForeignKey("RevisionInformationId")
594  .OnDelete(DeleteBehavior.Cascade);
595 
596  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
597  .WithMany("RevisonInformations")
598  .HasForeignKey("TestMergeId")
599  .OnDelete(DeleteBehavior.Cascade);
600  });
601 
602  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
603  {
604  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
605  .WithMany("RevisionInformations")
606  .HasForeignKey("InstanceId")
607  .OnDelete(DeleteBehavior.Cascade);
608  });
609 
610  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
611  {
612  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
613  .WithMany("TestMerges")
614  .HasForeignKey("MergedById")
615  .OnDelete(DeleteBehavior.Restrict);
616 
617  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
618  .WithOne("PrimaryTestMerge")
619  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
620  .OnDelete(DeleteBehavior.SetNull);
621  });
622 
623  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
624  {
625  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
626  .WithMany("CreatedUsers")
627  .HasForeignKey("CreatedById");
628  });
629 
630  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
631  {
632  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
633  .WithMany()
634  .HasForeignKey("AlphaId");
635 
636  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
637  .WithMany()
638  .HasForeignKey("BravoId");
639  });
640 #pragma warning restore 612, 618
641  }
642  }
643 }
-
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
-
DatabaseContext<TParentContext> for MySQL
- - - - +
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
+
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MYInitialCreate
 The initial database migration for MySQL/MariaDB More...
class  Tgstation.Server.Host.Database.Migrations.MYInitialCreate
 The initial database migration for MySQL/MariaDB More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180906143029___m_y_initial_create_8cs_source.html b/20180906143029___m_y_initial_create_8cs_source.html index 077118ef47..f8f8dd9651 100644 --- a/20180906143029___m_y_initial_create_8cs_source.html +++ b/20180906143029___m_y_initial_create_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180906143029_MYInitialCreate.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180906143029_MYInitialCreate.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,21 +71,21 @@ $(function() {
20180906143029_MYInitialCreate.cs
-Go to the documentation of this file.
1 using System;
2 using Microsoft.EntityFrameworkCore.Metadata;
3 using Microsoft.EntityFrameworkCore.Migrations;
4 
6 {
10  #pragma warning disable CA1506
11  public partial class MYInitialCreate : Migration
12  {
17  protected override void Up(MigrationBuilder migrationBuilder)
18  {
19  if (migrationBuilder == null)
20  throw new ArgumentNullException(nameof(migrationBuilder));
21 
22  migrationBuilder.CreateTable(
23  name: "Users",
24  columns: table => new
25  {
26  Id = table.Column<long>(nullable: false)
27  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
28  Enabled = table.Column<bool>(nullable: false),
29  CreatedAt = table.Column<DateTimeOffset>(nullable: false),
30  SystemIdentifier = table.Column<string>(nullable: true),
31  Name = table.Column<string>(nullable: false),
32  AdministrationRights = table.Column<ulong>(nullable: false),
33  InstanceManagerRights = table.Column<ulong>(nullable: false),
34  PasswordHash = table.Column<string>(nullable: true),
35  CreatedById = table.Column<long>(nullable: true),
36  CanonicalName = table.Column<string>(nullable: false),
37  LastPasswordUpdate = table.Column<DateTimeOffset>(nullable: true)
38  },
39  constraints: table =>
40  {
41  table.PrimaryKey("PK_Users", x => x.Id);
42  table.ForeignKey(
43  name: "FK_Users_Users_CreatedById",
44  column: x => x.CreatedById,
45  principalTable: "Users",
46  principalColumn: "Id",
47  onDelete: ReferentialAction.Restrict);
48  });
49 
50  migrationBuilder.CreateTable(
51  name: "ChatChannels",
52  columns: table => new
53  {
54  IrcChannel = table.Column<string>(nullable: true),
55  DiscordChannelId = table.Column<ulong>(nullable: true),
56  IsAdminChannel = table.Column<bool>(nullable: false),
57  IsWatchdogChannel = table.Column<bool>(nullable: false),
58  IsUpdatesChannel = table.Column<bool>(nullable: false),
59  Tag = table.Column<string>(nullable: true),
60  Id = table.Column<long>(nullable: false)
61  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
62  ChatSettingsId = table.Column<long>(nullable: false)
63  },
64  constraints: table =>
65  {
66  table.PrimaryKey("PK_ChatChannels", x => x.Id);
67  });
68 
69  migrationBuilder.CreateTable(
70  name: "ReattachInformations",
71  columns: table => new
72  {
73  ChatCommandsJson = table.Column<string>(nullable: false),
74  ChatChannelsJson = table.Column<string>(nullable: false),
75  ServerCommandsJson = table.Column<string>(nullable: false),
76  AccessIdentifier = table.Column<string>(nullable: false),
77  ProcessId = table.Column<int>(nullable: false),
78  IsPrimary = table.Column<bool>(nullable: false),
79  Port = table.Column<ushort>(nullable: false),
80  RebootState = table.Column<int>(nullable: false),
81  Id = table.Column<long>(nullable: false)
82  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
83  CompileJobId = table.Column<long>(nullable: true)
84  },
85  constraints: table =>
86  {
87  table.PrimaryKey("PK_ReattachInformations", x => x.Id);
88  });
89 
90  migrationBuilder.CreateTable(
91  name: "WatchdogReattachInformations",
92  columns: table => new
93  {
94  AlphaIsActive = table.Column<bool>(nullable: false),
95  Id = table.Column<long>(nullable: false)
96  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
97  AlphaId = table.Column<long>(nullable: true),
98  BravoId = table.Column<long>(nullable: true)
99  },
100  constraints: table =>
101  {
102  table.PrimaryKey("PK_WatchdogReattachInformations", x => x.Id);
103  table.ForeignKey(
104  name: "FK_WatchdogReattachInformations_ReattachInformations_AlphaId",
105  column: x => x.AlphaId,
106  principalTable: "ReattachInformations",
107  principalColumn: "Id",
108  onDelete: ReferentialAction.Restrict);
109  table.ForeignKey(
110  name: "FK_WatchdogReattachInformations_ReattachInformations_BravoId",
111  column: x => x.BravoId,
112  principalTable: "ReattachInformations",
113  principalColumn: "Id",
114  onDelete: ReferentialAction.Restrict);
115  });
116 
117  migrationBuilder.CreateTable(
118  name: "Instances",
119  columns: table => new
120  {
121  Id = table.Column<long>(nullable: false)
122  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
123  Name = table.Column<string>(nullable: false),
124  Path = table.Column<string>(nullable: false),
125  Online = table.Column<bool>(nullable: false),
126  ConfigurationType = table.Column<int>(nullable: false),
127  AutoUpdateInterval = table.Column<uint>(nullable: false),
128  WatchdogReattachInformationId = table.Column<long>(nullable: true)
129  },
130  constraints: table =>
131  {
132  table.PrimaryKey("PK_Instances", x => x.Id);
133  table.ForeignKey(
134  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInfor~",
135  column: x => x.WatchdogReattachInformationId,
136  principalTable: "WatchdogReattachInformations",
137  principalColumn: "Id",
138  onDelete: ReferentialAction.Restrict);
139  });
140 
141  migrationBuilder.CreateTable(
142  name: "ChatBots",
143  columns: table => new
144  {
145  Id = table.Column<long>(nullable: false)
146  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
147  Name = table.Column<string>(nullable: false),
148  Enabled = table.Column<bool>(nullable: true),
149  Provider = table.Column<int>(nullable: true),
150  ConnectionString = table.Column<string>(nullable: false),
151  InstanceId = table.Column<long>(nullable: false)
152  },
153  constraints: table =>
154  {
155  table.PrimaryKey("PK_ChatBots", x => x.Id);
156  table.ForeignKey(
157  name: "FK_ChatBots_Instances_InstanceId",
158  column: x => x.InstanceId,
159  principalTable: "Instances",
160  principalColumn: "Id",
161  onDelete: ReferentialAction.Cascade);
162  });
163 
164  migrationBuilder.CreateTable(
165  name: "DreamDaemonSettings",
166  columns: table => new
167  {
168  AllowWebClient = table.Column<bool>(nullable: false),
169  SecurityLevel = table.Column<int>(nullable: false),
170  PrimaryPort = table.Column<ushort>(nullable: false),
171  SecondaryPort = table.Column<ushort>(nullable: false),
172  StartupTimeout = table.Column<uint>(nullable: false),
173  AutoStart = table.Column<bool>(nullable: false),
174  SoftRestart = table.Column<bool>(nullable: false),
175  SoftShutdown = table.Column<bool>(nullable: false),
176  Id = table.Column<long>(nullable: false)
177  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
178  ProcessId = table.Column<int>(nullable: true),
179  AccessToken = table.Column<string>(nullable: true),
180  InstanceId = table.Column<long>(nullable: false)
181  },
182  constraints: table =>
183  {
184  table.PrimaryKey("PK_DreamDaemonSettings", x => x.Id);
185  table.ForeignKey(
186  name: "FK_DreamDaemonSettings_Instances_InstanceId",
187  column: x => x.InstanceId,
188  principalTable: "Instances",
189  principalColumn: "Id",
190  onDelete: ReferentialAction.Cascade);
191  });
192 
193  migrationBuilder.CreateTable(
194  name: "DreamMakerSettings",
195  columns: table => new
196  {
197  ProjectName = table.Column<string>(nullable: true),
198  ApiValidationPort = table.Column<ushort>(nullable: false),
199  Id = table.Column<long>(nullable: false)
200  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
201  InstanceId = table.Column<long>(nullable: false)
202  },
203  constraints: table =>
204  {
205  table.PrimaryKey("PK_DreamMakerSettings", x => x.Id);
206  table.ForeignKey(
207  name: "FK_DreamMakerSettings_Instances_InstanceId",
208  column: x => x.InstanceId,
209  principalTable: "Instances",
210  principalColumn: "Id",
211  onDelete: ReferentialAction.Cascade);
212  });
213 
214  migrationBuilder.CreateTable(
215  name: "InstanceUsers",
216  columns: table => new
217  {
218  UserId = table.Column<long>(nullable: false),
219  InstanceUserRights = table.Column<ulong>(nullable: false),
220  ByondRights = table.Column<ulong>(nullable: false),
221  DreamDaemonRights = table.Column<ulong>(nullable: false),
222  DreamMakerRights = table.Column<ulong>(nullable: false),
223  RepositoryRights = table.Column<ulong>(nullable: false),
224  ChatBotRights = table.Column<ulong>(nullable: false),
225  ConfigurationRights = table.Column<ulong>(nullable: false),
226  Id = table.Column<long>(nullable: false)
227  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
228  InstanceId = table.Column<long>(nullable: false)
229  },
230  constraints: table =>
231  {
232  table.PrimaryKey("PK_InstanceUsers", x => x.Id);
233  table.ForeignKey(
234  name: "FK_InstanceUsers_Instances_InstanceId",
235  column: x => x.InstanceId,
236  principalTable: "Instances",
237  principalColumn: "Id",
238  onDelete: ReferentialAction.Cascade);
239  table.ForeignKey(
240  name: "FK_InstanceUsers_Users_UserId",
241  column: x => x.UserId,
242  principalTable: "Users",
243  principalColumn: "Id",
244  onDelete: ReferentialAction.Cascade);
245  });
246 
247  migrationBuilder.CreateTable(
248  name: "Jobs",
249  columns: table => new
250  {
251  Id = table.Column<long>(nullable: false)
252  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
253  Description = table.Column<string>(nullable: false),
254  ExceptionDetails = table.Column<string>(nullable: true),
255  StartedAt = table.Column<DateTimeOffset>(nullable: false),
256  StoppedAt = table.Column<DateTimeOffset>(nullable: true),
257  Cancelled = table.Column<bool>(nullable: false),
258  CancelRightsType = table.Column<ulong>(nullable: true),
259  CancelRight = table.Column<ulong>(nullable: true),
260  StartedById = table.Column<long>(nullable: false),
261  CancelledById = table.Column<long>(nullable: true),
262  InstanceId = table.Column<long>(nullable: false)
263  },
264  constraints: table =>
265  {
266  table.PrimaryKey("PK_Jobs", x => x.Id);
267  table.ForeignKey(
268  name: "FK_Jobs_Users_CancelledById",
269  column: x => x.CancelledById,
270  principalTable: "Users",
271  principalColumn: "Id",
272  onDelete: ReferentialAction.Restrict);
273  table.ForeignKey(
274  name: "FK_Jobs_Instances_InstanceId",
275  column: x => x.InstanceId,
276  principalTable: "Instances",
277  principalColumn: "Id",
278  onDelete: ReferentialAction.Cascade);
279  table.ForeignKey(
280  name: "FK_Jobs_Users_StartedById",
281  column: x => x.StartedById,
282  principalTable: "Users",
283  principalColumn: "Id",
284  onDelete: ReferentialAction.Cascade);
285  });
286 
287  migrationBuilder.CreateTable(
288  name: "RepositorySettings",
289  columns: table => new
290  {
291  CommitterName = table.Column<string>(nullable: false),
292  CommitterEmail = table.Column<string>(nullable: false),
293  AccessUser = table.Column<string>(nullable: true),
294  AccessToken = table.Column<string>(nullable: true),
295  PushTestMergeCommits = table.Column<bool>(nullable: false),
296  ShowTestMergeCommitters = table.Column<bool>(nullable: false),
297  AutoUpdatesKeepTestMerges = table.Column<bool>(nullable: false),
298  AutoUpdatesSynchronize = table.Column<bool>(nullable: false),
299  Id = table.Column<long>(nullable: false)
300  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
301  InstanceId = table.Column<long>(nullable: false)
302  },
303  constraints: table =>
304  {
305  table.PrimaryKey("PK_RepositorySettings", x => x.Id);
306  table.ForeignKey(
307  name: "FK_RepositorySettings_Instances_InstanceId",
308  column: x => x.InstanceId,
309  principalTable: "Instances",
310  principalColumn: "Id",
311  onDelete: ReferentialAction.Cascade);
312  });
313 
314  migrationBuilder.CreateTable(
315  name: "RevisionInformations",
316  columns: table => new
317  {
318  CommitSha = table.Column<string>(maxLength: 40, nullable: false),
319  OriginCommitSha = table.Column<string>(maxLength: 40, nullable: false),
320  Id = table.Column<long>(nullable: false)
321  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
322  InstanceId = table.Column<long>(nullable: false)
323  },
324  constraints: table =>
325  {
326  table.PrimaryKey("PK_RevisionInformations", x => x.Id);
327  table.ForeignKey(
328  name: "FK_RevisionInformations_Instances_InstanceId",
329  column: x => x.InstanceId,
330  principalTable: "Instances",
331  principalColumn: "Id",
332  onDelete: ReferentialAction.Cascade);
333  });
334 
335  migrationBuilder.CreateTable(
336  name: "CompileJobs",
337  columns: table => new
338  {
339  Id = table.Column<long>(nullable: false)
340  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
341  DmeName = table.Column<string>(nullable: true),
342  Output = table.Column<string>(nullable: true),
343  DirectoryName = table.Column<Guid>(nullable: true),
344  JobId = table.Column<long>(nullable: true),
345  RevisionInformationId = table.Column<long>(nullable: false),
346  ByondVersion = table.Column<string>(nullable: false)
347  },
348  constraints: table =>
349  {
350  table.PrimaryKey("PK_CompileJobs", x => x.Id);
351  table.ForeignKey(
352  name: "FK_CompileJobs_Jobs_JobId",
353  column: x => x.JobId,
354  principalTable: "Jobs",
355  principalColumn: "Id",
356  onDelete: ReferentialAction.Restrict);
357  table.ForeignKey(
358  name: "FK_CompileJobs_RevisionInformations_RevisionInformationId",
359  column: x => x.RevisionInformationId,
360  principalTable: "RevisionInformations",
361  principalColumn: "Id",
362  onDelete: ReferentialAction.Cascade);
363  });
364 
365  migrationBuilder.CreateTable(
366  name: "TestMerges",
367  columns: table => new
368  {
369  Number = table.Column<int>(nullable: false),
370  PullRequestRevision = table.Column<string>(nullable: false),
371  Comment = table.Column<string>(nullable: true),
372  TitleAtMerge = table.Column<string>(nullable: false),
373  BodyAtMerge = table.Column<string>(nullable: false),
374  Url = table.Column<string>(nullable: false),
375  Author = table.Column<string>(nullable: false),
376  Id = table.Column<long>(nullable: false)
377  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
378  MergedAt = table.Column<DateTimeOffset>(nullable: false),
379  MergedById = table.Column<long>(nullable: false),
380  PrimaryRevisionInformationId = table.Column<long>(nullable: true)
381  },
382  constraints: table =>
383  {
384  table.PrimaryKey("PK_TestMerges", x => x.Id);
385  table.ForeignKey(
386  name: "FK_TestMerges_Users_MergedById",
387  column: x => x.MergedById,
388  principalTable: "Users",
389  principalColumn: "Id",
390  onDelete: ReferentialAction.Restrict);
391  table.ForeignKey(
392  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
393  column: x => x.PrimaryRevisionInformationId,
394  principalTable: "RevisionInformations",
395  principalColumn: "Id",
396  onDelete: ReferentialAction.SetNull);
397  });
398 
399  migrationBuilder.CreateTable(
400  name: "RevInfoTestMerges",
401  columns: table => new
402  {
403  Id = table.Column<long>(nullable: false)
404  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
405  TestMergeId = table.Column<long>(nullable: false),
406  RevisionInformationId = table.Column<long>(nullable: false)
407  },
408  constraints: table =>
409  {
410  table.PrimaryKey("PK_RevInfoTestMerges", x => x.Id);
411  table.ForeignKey(
412  name: "FK_RevInfoTestMerges_RevisionInformations_RevisionInformationId",
413  column: x => x.RevisionInformationId,
414  principalTable: "RevisionInformations",
415  principalColumn: "Id",
416  onDelete: ReferentialAction.Cascade);
417  table.ForeignKey(
418  name: "FK_RevInfoTestMerges_TestMerges_TestMergeId",
419  column: x => x.TestMergeId,
420  principalTable: "TestMerges",
421  principalColumn: "Id",
422  onDelete: ReferentialAction.Cascade);
423  });
424 
425  migrationBuilder.CreateIndex(
426  name: "IX_ChatBots_InstanceId",
427  table: "ChatBots",
428  column: "InstanceId");
429 
430  migrationBuilder.CreateIndex(
431  name: "IX_ChatBots_Name",
432  table: "ChatBots",
433  column: "Name",
434  unique: true);
435 
436  migrationBuilder.CreateIndex(
437  name: "IX_ChatChannels_ChatSettingsId_DiscordChannelId",
438  table: "ChatChannels",
439  columns: new[] { "ChatSettingsId", "DiscordChannelId" },
440  unique: true);
441 
442  migrationBuilder.CreateIndex(
443  name: "IX_ChatChannels_ChatSettingsId_IrcChannel",
444  table: "ChatChannels",
445  columns: new[] { "ChatSettingsId", "IrcChannel" },
446  unique: true);
447 
448  migrationBuilder.CreateIndex(
449  name: "IX_CompileJobs_DirectoryName",
450  table: "CompileJobs",
451  column: "DirectoryName");
452 
453  migrationBuilder.CreateIndex(
454  name: "IX_CompileJobs_JobId",
455  table: "CompileJobs",
456  column: "JobId");
457 
458  migrationBuilder.CreateIndex(
459  name: "IX_CompileJobs_RevisionInformationId",
460  table: "CompileJobs",
461  column: "RevisionInformationId");
462 
463  migrationBuilder.CreateIndex(
464  name: "IX_DreamDaemonSettings_InstanceId",
465  table: "DreamDaemonSettings",
466  column: "InstanceId",
467  unique: true);
468 
469  migrationBuilder.CreateIndex(
470  name: "IX_DreamMakerSettings_InstanceId",
471  table: "DreamMakerSettings",
472  column: "InstanceId",
473  unique: true);
474 
475  migrationBuilder.CreateIndex(
476  name: "IX_Instances_Path",
477  table: "Instances",
478  column: "Path",
479  unique: true);
480 
481  migrationBuilder.CreateIndex(
482  name: "IX_Instances_WatchdogReattachInformationId",
483  table: "Instances",
484  column: "WatchdogReattachInformationId");
485 
486  migrationBuilder.CreateIndex(
487  name: "IX_InstanceUsers_InstanceId",
488  table: "InstanceUsers",
489  column: "InstanceId");
490 
491  migrationBuilder.CreateIndex(
492  name: "IX_InstanceUsers_UserId_InstanceId",
493  table: "InstanceUsers",
494  columns: new[] { "UserId", "InstanceId" },
495  unique: true);
496 
497  migrationBuilder.CreateIndex(
498  name: "IX_Jobs_CancelledById",
499  table: "Jobs",
500  column: "CancelledById");
501 
502  migrationBuilder.CreateIndex(
503  name: "IX_Jobs_InstanceId",
504  table: "Jobs",
505  column: "InstanceId");
506 
507  migrationBuilder.CreateIndex(
508  name: "IX_Jobs_StartedById",
509  table: "Jobs",
510  column: "StartedById");
511 
512  migrationBuilder.CreateIndex(
513  name: "IX_ReattachInformations_CompileJobId",
514  table: "ReattachInformations",
515  column: "CompileJobId");
516 
517  migrationBuilder.CreateIndex(
518  name: "IX_RepositorySettings_InstanceId",
519  table: "RepositorySettings",
520  column: "InstanceId",
521  unique: true);
522 
523  migrationBuilder.CreateIndex(
524  name: "IX_RevInfoTestMerges_RevisionInformationId",
525  table: "RevInfoTestMerges",
526  column: "RevisionInformationId");
527 
528  migrationBuilder.CreateIndex(
529  name: "IX_RevInfoTestMerges_TestMergeId",
530  table: "RevInfoTestMerges",
531  column: "TestMergeId");
532 
533  migrationBuilder.CreateIndex(
534  name: "IX_RevisionInformations_CommitSha",
535  table: "RevisionInformations",
536  column: "CommitSha",
537  unique: true);
538 
539  migrationBuilder.CreateIndex(
540  name: "IX_RevisionInformations_InstanceId",
541  table: "RevisionInformations",
542  column: "InstanceId");
543 
544  migrationBuilder.CreateIndex(
545  name: "IX_TestMerges_MergedById",
546  table: "TestMerges",
547  column: "MergedById");
548 
549  migrationBuilder.CreateIndex(
550  name: "IX_TestMerges_PrimaryRevisionInformationId",
551  table: "TestMerges",
552  column: "PrimaryRevisionInformationId",
553  unique: true);
554 
555  migrationBuilder.CreateIndex(
556  name: "IX_Users_CanonicalName",
557  table: "Users",
558  column: "CanonicalName",
559  unique: true);
560 
561  migrationBuilder.CreateIndex(
562  name: "IX_Users_CreatedById",
563  table: "Users",
564  column: "CreatedById");
565 
566  migrationBuilder.CreateIndex(
567  name: "IX_WatchdogReattachInformations_AlphaId",
568  table: "WatchdogReattachInformations",
569  column: "AlphaId");
570 
571  migrationBuilder.CreateIndex(
572  name: "IX_WatchdogReattachInformations_BravoId",
573  table: "WatchdogReattachInformations",
574  column: "BravoId");
575 
576  migrationBuilder.AddForeignKey(
577  name: "FK_ChatChannels_ChatBots_ChatSettingsId",
578  table: "ChatChannels",
579  column: "ChatSettingsId",
580  principalTable: "ChatBots",
581  principalColumn: "Id",
582  onDelete: ReferentialAction.Cascade);
583 
584  migrationBuilder.AddForeignKey(
585  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
586  table: "ReattachInformations",
587  column: "CompileJobId",
588  principalTable: "CompileJobs",
589  principalColumn: "Id",
590  onDelete: ReferentialAction.Restrict);
591  }
592 
597  protected override void Down(MigrationBuilder migrationBuilder)
598  {
599  if (migrationBuilder == null)
600  throw new ArgumentNullException(nameof(migrationBuilder));
601 
602  migrationBuilder.DropForeignKey(
603  name: "FK_Jobs_Instances_InstanceId",
604  table: "Jobs");
605 
606  migrationBuilder.DropForeignKey(
607  name: "FK_RevisionInformations_Instances_InstanceId",
608  table: "RevisionInformations");
609 
610  migrationBuilder.DropTable(
611  name: "ChatChannels");
612 
613  migrationBuilder.DropTable(
614  name: "DreamDaemonSettings");
615 
616  migrationBuilder.DropTable(
617  name: "DreamMakerSettings");
618 
619  migrationBuilder.DropTable(
620  name: "InstanceUsers");
621 
622  migrationBuilder.DropTable(
623  name: "RepositorySettings");
624 
625  migrationBuilder.DropTable(
626  name: "RevInfoTestMerges");
627 
628  migrationBuilder.DropTable(
629  name: "ChatBots");
630 
631  migrationBuilder.DropTable(
632  name: "TestMerges");
633 
634  migrationBuilder.DropTable(
635  name: "Instances");
636 
637  migrationBuilder.DropTable(
638  name: "WatchdogReattachInformations");
639 
640  migrationBuilder.DropTable(
641  name: "ReattachInformations");
642 
643  migrationBuilder.DropTable(
644  name: "CompileJobs");
645 
646  migrationBuilder.DropTable(
647  name: "Jobs");
648 
649  migrationBuilder.DropTable(
650  name: "RevisionInformations");
651 
652  migrationBuilder.DropTable(
653  name: "Users");
654  }
655  }
656 }
ConfigurationRights
Rights for Models.ConfigurationFile
+Go to the documentation of this file.
1 using System;
2 using Microsoft.EntityFrameworkCore.Metadata;
3 using Microsoft.EntityFrameworkCore.Migrations;
4 
6 {
10  #pragma warning disable CA1506
11  public partial class MYInitialCreate : Migration
12  {
17  protected override void Up(MigrationBuilder migrationBuilder)
18  {
19  if (migrationBuilder == null)
20  throw new ArgumentNullException(nameof(migrationBuilder));
21 
22  migrationBuilder.CreateTable(
23  name: "Users",
24  columns: table => new
25  {
26  Id = table.Column<long>(nullable: false)
27  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
28  Enabled = table.Column<bool>(nullable: false),
29  CreatedAt = table.Column<DateTimeOffset>(nullable: false),
30  SystemIdentifier = table.Column<string>(nullable: true),
31  Name = table.Column<string>(nullable: false),
32  AdministrationRights = table.Column<ulong>(nullable: false),
33  InstanceManagerRights = table.Column<ulong>(nullable: false),
34  PasswordHash = table.Column<string>(nullable: true),
35  CreatedById = table.Column<long>(nullable: true),
36  CanonicalName = table.Column<string>(nullable: false),
37  LastPasswordUpdate = table.Column<DateTimeOffset>(nullable: true)
38  },
39  constraints: table =>
40  {
41  table.PrimaryKey("PK_Users", x => x.Id);
42  table.ForeignKey(
43  name: "FK_Users_Users_CreatedById",
44  column: x => x.CreatedById,
45  principalTable: "Users",
46  principalColumn: "Id",
47  onDelete: ReferentialAction.Restrict);
48  });
49 
50  migrationBuilder.CreateTable(
51  name: "ChatChannels",
52  columns: table => new
53  {
54  IrcChannel = table.Column<string>(nullable: true),
55  DiscordChannelId = table.Column<ulong>(nullable: true),
56  IsAdminChannel = table.Column<bool>(nullable: false),
57  IsWatchdogChannel = table.Column<bool>(nullable: false),
58  IsUpdatesChannel = table.Column<bool>(nullable: false),
59  Tag = table.Column<string>(nullable: true),
60  Id = table.Column<long>(nullable: false)
61  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
62  ChatSettingsId = table.Column<long>(nullable: false)
63  },
64  constraints: table =>
65  {
66  table.PrimaryKey("PK_ChatChannels", x => x.Id);
67  });
68 
69  migrationBuilder.CreateTable(
70  name: "ReattachInformations",
71  columns: table => new
72  {
73  ChatCommandsJson = table.Column<string>(nullable: false),
74  ChatChannelsJson = table.Column<string>(nullable: false),
75  ServerCommandsJson = table.Column<string>(nullable: false),
76  AccessIdentifier = table.Column<string>(nullable: false),
77  ProcessId = table.Column<int>(nullable: false),
78  IsPrimary = table.Column<bool>(nullable: false),
79  Port = table.Column<ushort>(nullable: false),
80  RebootState = table.Column<int>(nullable: false),
81  Id = table.Column<long>(nullable: false)
82  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
83  CompileJobId = table.Column<long>(nullable: true)
84  },
85  constraints: table =>
86  {
87  table.PrimaryKey("PK_ReattachInformations", x => x.Id);
88  });
89 
90  migrationBuilder.CreateTable(
91  name: "WatchdogReattachInformations",
92  columns: table => new
93  {
94  AlphaIsActive = table.Column<bool>(nullable: false),
95  Id = table.Column<long>(nullable: false)
96  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
97  AlphaId = table.Column<long>(nullable: true),
98  BravoId = table.Column<long>(nullable: true)
99  },
100  constraints: table =>
101  {
102  table.PrimaryKey("PK_WatchdogReattachInformations", x => x.Id);
103  table.ForeignKey(
104  name: "FK_WatchdogReattachInformations_ReattachInformations_AlphaId",
105  column: x => x.AlphaId,
106  principalTable: "ReattachInformations",
107  principalColumn: "Id",
108  onDelete: ReferentialAction.Restrict);
109  table.ForeignKey(
110  name: "FK_WatchdogReattachInformations_ReattachInformations_BravoId",
111  column: x => x.BravoId,
112  principalTable: "ReattachInformations",
113  principalColumn: "Id",
114  onDelete: ReferentialAction.Restrict);
115  });
116 
117  migrationBuilder.CreateTable(
118  name: "Instances",
119  columns: table => new
120  {
121  Id = table.Column<long>(nullable: false)
122  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
123  Name = table.Column<string>(nullable: false),
124  Path = table.Column<string>(nullable: false),
125  Online = table.Column<bool>(nullable: false),
126  ConfigurationType = table.Column<int>(nullable: false),
127  AutoUpdateInterval = table.Column<uint>(nullable: false),
128  WatchdogReattachInformationId = table.Column<long>(nullable: true)
129  },
130  constraints: table =>
131  {
132  table.PrimaryKey("PK_Instances", x => x.Id);
133  table.ForeignKey(
134  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInfor~",
135  column: x => x.WatchdogReattachInformationId,
136  principalTable: "WatchdogReattachInformations",
137  principalColumn: "Id",
138  onDelete: ReferentialAction.Restrict);
139  });
140 
141  migrationBuilder.CreateTable(
142  name: "ChatBots",
143  columns: table => new
144  {
145  Id = table.Column<long>(nullable: false)
146  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
147  Name = table.Column<string>(nullable: false),
148  Enabled = table.Column<bool>(nullable: true),
149  Provider = table.Column<int>(nullable: true),
150  ConnectionString = table.Column<string>(nullable: false),
151  InstanceId = table.Column<long>(nullable: false)
152  },
153  constraints: table =>
154  {
155  table.PrimaryKey("PK_ChatBots", x => x.Id);
156  table.ForeignKey(
157  name: "FK_ChatBots_Instances_InstanceId",
158  column: x => x.InstanceId,
159  principalTable: "Instances",
160  principalColumn: "Id",
161  onDelete: ReferentialAction.Cascade);
162  });
163 
164  migrationBuilder.CreateTable(
165  name: "DreamDaemonSettings",
166  columns: table => new
167  {
168  AllowWebClient = table.Column<bool>(nullable: false),
169  SecurityLevel = table.Column<int>(nullable: false),
170  PrimaryPort = table.Column<ushort>(nullable: false),
171  SecondaryPort = table.Column<ushort>(nullable: false),
172  StartupTimeout = table.Column<uint>(nullable: false),
173  AutoStart = table.Column<bool>(nullable: false),
174  SoftRestart = table.Column<bool>(nullable: false),
175  SoftShutdown = table.Column<bool>(nullable: false),
176  Id = table.Column<long>(nullable: false)
177  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
178  ProcessId = table.Column<int>(nullable: true),
179  AccessToken = table.Column<string>(nullable: true),
180  InstanceId = table.Column<long>(nullable: false)
181  },
182  constraints: table =>
183  {
184  table.PrimaryKey("PK_DreamDaemonSettings", x => x.Id);
185  table.ForeignKey(
186  name: "FK_DreamDaemonSettings_Instances_InstanceId",
187  column: x => x.InstanceId,
188  principalTable: "Instances",
189  principalColumn: "Id",
190  onDelete: ReferentialAction.Cascade);
191  });
192 
193  migrationBuilder.CreateTable(
194  name: "DreamMakerSettings",
195  columns: table => new
196  {
197  ProjectName = table.Column<string>(nullable: true),
198  ApiValidationPort = table.Column<ushort>(nullable: false),
199  Id = table.Column<long>(nullable: false)
200  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
201  InstanceId = table.Column<long>(nullable: false)
202  },
203  constraints: table =>
204  {
205  table.PrimaryKey("PK_DreamMakerSettings", x => x.Id);
206  table.ForeignKey(
207  name: "FK_DreamMakerSettings_Instances_InstanceId",
208  column: x => x.InstanceId,
209  principalTable: "Instances",
210  principalColumn: "Id",
211  onDelete: ReferentialAction.Cascade);
212  });
213 
214  migrationBuilder.CreateTable(
215  name: "InstanceUsers",
216  columns: table => new
217  {
218  UserId = table.Column<long>(nullable: false),
219  InstanceUserRights = table.Column<ulong>(nullable: false),
220  ByondRights = table.Column<ulong>(nullable: false),
221  DreamDaemonRights = table.Column<ulong>(nullable: false),
222  DreamMakerRights = table.Column<ulong>(nullable: false),
223  RepositoryRights = table.Column<ulong>(nullable: false),
224  ChatBotRights = table.Column<ulong>(nullable: false),
225  ConfigurationRights = table.Column<ulong>(nullable: false),
226  Id = table.Column<long>(nullable: false)
227  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
228  InstanceId = table.Column<long>(nullable: false)
229  },
230  constraints: table =>
231  {
232  table.PrimaryKey("PK_InstanceUsers", x => x.Id);
233  table.ForeignKey(
234  name: "FK_InstanceUsers_Instances_InstanceId",
235  column: x => x.InstanceId,
236  principalTable: "Instances",
237  principalColumn: "Id",
238  onDelete: ReferentialAction.Cascade);
239  table.ForeignKey(
240  name: "FK_InstanceUsers_Users_UserId",
241  column: x => x.UserId,
242  principalTable: "Users",
243  principalColumn: "Id",
244  onDelete: ReferentialAction.Cascade);
245  });
246 
247  migrationBuilder.CreateTable(
248  name: "Jobs",
249  columns: table => new
250  {
251  Id = table.Column<long>(nullable: false)
252  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
253  Description = table.Column<string>(nullable: false),
254  ExceptionDetails = table.Column<string>(nullable: true),
255  StartedAt = table.Column<DateTimeOffset>(nullable: false),
256  StoppedAt = table.Column<DateTimeOffset>(nullable: true),
257  Cancelled = table.Column<bool>(nullable: false),
258  CancelRightsType = table.Column<ulong>(nullable: true),
259  CancelRight = table.Column<ulong>(nullable: true),
260  StartedById = table.Column<long>(nullable: false),
261  CancelledById = table.Column<long>(nullable: true),
262  InstanceId = table.Column<long>(nullable: false)
263  },
264  constraints: table =>
265  {
266  table.PrimaryKey("PK_Jobs", x => x.Id);
267  table.ForeignKey(
268  name: "FK_Jobs_Users_CancelledById",
269  column: x => x.CancelledById,
270  principalTable: "Users",
271  principalColumn: "Id",
272  onDelete: ReferentialAction.Restrict);
273  table.ForeignKey(
274  name: "FK_Jobs_Instances_InstanceId",
275  column: x => x.InstanceId,
276  principalTable: "Instances",
277  principalColumn: "Id",
278  onDelete: ReferentialAction.Cascade);
279  table.ForeignKey(
280  name: "FK_Jobs_Users_StartedById",
281  column: x => x.StartedById,
282  principalTable: "Users",
283  principalColumn: "Id",
284  onDelete: ReferentialAction.Cascade);
285  });
286 
287  migrationBuilder.CreateTable(
288  name: "RepositorySettings",
289  columns: table => new
290  {
291  CommitterName = table.Column<string>(nullable: false),
292  CommitterEmail = table.Column<string>(nullable: false),
293  AccessUser = table.Column<string>(nullable: true),
294  AccessToken = table.Column<string>(nullable: true),
295  PushTestMergeCommits = table.Column<bool>(nullable: false),
296  ShowTestMergeCommitters = table.Column<bool>(nullable: false),
297  AutoUpdatesKeepTestMerges = table.Column<bool>(nullable: false),
298  AutoUpdatesSynchronize = table.Column<bool>(nullable: false),
299  Id = table.Column<long>(nullable: false)
300  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
301  InstanceId = table.Column<long>(nullable: false)
302  },
303  constraints: table =>
304  {
305  table.PrimaryKey("PK_RepositorySettings", x => x.Id);
306  table.ForeignKey(
307  name: "FK_RepositorySettings_Instances_InstanceId",
308  column: x => x.InstanceId,
309  principalTable: "Instances",
310  principalColumn: "Id",
311  onDelete: ReferentialAction.Cascade);
312  });
313 
314  migrationBuilder.CreateTable(
315  name: "RevisionInformations",
316  columns: table => new
317  {
318  CommitSha = table.Column<string>(maxLength: 40, nullable: false),
319  OriginCommitSha = table.Column<string>(maxLength: 40, nullable: false),
320  Id = table.Column<long>(nullable: false)
321  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
322  InstanceId = table.Column<long>(nullable: false)
323  },
324  constraints: table =>
325  {
326  table.PrimaryKey("PK_RevisionInformations", x => x.Id);
327  table.ForeignKey(
328  name: "FK_RevisionInformations_Instances_InstanceId",
329  column: x => x.InstanceId,
330  principalTable: "Instances",
331  principalColumn: "Id",
332  onDelete: ReferentialAction.Cascade);
333  });
334 
335  migrationBuilder.CreateTable(
336  name: "CompileJobs",
337  columns: table => new
338  {
339  Id = table.Column<long>(nullable: false)
340  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
341  DmeName = table.Column<string>(nullable: true),
342  Output = table.Column<string>(nullable: true),
343  DirectoryName = table.Column<Guid>(nullable: true),
344  JobId = table.Column<long>(nullable: true),
345  RevisionInformationId = table.Column<long>(nullable: false),
346  ByondVersion = table.Column<string>(nullable: false)
347  },
348  constraints: table =>
349  {
350  table.PrimaryKey("PK_CompileJobs", x => x.Id);
351  table.ForeignKey(
352  name: "FK_CompileJobs_Jobs_JobId",
353  column: x => x.JobId,
354  principalTable: "Jobs",
355  principalColumn: "Id",
356  onDelete: ReferentialAction.Restrict);
357  table.ForeignKey(
358  name: "FK_CompileJobs_RevisionInformations_RevisionInformationId",
359  column: x => x.RevisionInformationId,
360  principalTable: "RevisionInformations",
361  principalColumn: "Id",
362  onDelete: ReferentialAction.Cascade);
363  });
364 
365  migrationBuilder.CreateTable(
366  name: "TestMerges",
367  columns: table => new
368  {
369  Number = table.Column<int>(nullable: false),
370  PullRequestRevision = table.Column<string>(nullable: false),
371  Comment = table.Column<string>(nullable: true),
372  TitleAtMerge = table.Column<string>(nullable: false),
373  BodyAtMerge = table.Column<string>(nullable: false),
374  Url = table.Column<string>(nullable: false),
375  Author = table.Column<string>(nullable: false),
376  Id = table.Column<long>(nullable: false)
377  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
378  MergedAt = table.Column<DateTimeOffset>(nullable: false),
379  MergedById = table.Column<long>(nullable: false),
380  PrimaryRevisionInformationId = table.Column<long>(nullable: true)
381  },
382  constraints: table =>
383  {
384  table.PrimaryKey("PK_TestMerges", x => x.Id);
385  table.ForeignKey(
386  name: "FK_TestMerges_Users_MergedById",
387  column: x => x.MergedById,
388  principalTable: "Users",
389  principalColumn: "Id",
390  onDelete: ReferentialAction.Restrict);
391  table.ForeignKey(
392  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
393  column: x => x.PrimaryRevisionInformationId,
394  principalTable: "RevisionInformations",
395  principalColumn: "Id",
396  onDelete: ReferentialAction.SetNull);
397  });
398 
399  migrationBuilder.CreateTable(
400  name: "RevInfoTestMerges",
401  columns: table => new
402  {
403  Id = table.Column<long>(nullable: false)
404  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
405  TestMergeId = table.Column<long>(nullable: false),
406  RevisionInformationId = table.Column<long>(nullable: false)
407  },
408  constraints: table =>
409  {
410  table.PrimaryKey("PK_RevInfoTestMerges", x => x.Id);
411  table.ForeignKey(
412  name: "FK_RevInfoTestMerges_RevisionInformations_RevisionInformationId",
413  column: x => x.RevisionInformationId,
414  principalTable: "RevisionInformations",
415  principalColumn: "Id",
416  onDelete: ReferentialAction.Cascade);
417  table.ForeignKey(
418  name: "FK_RevInfoTestMerges_TestMerges_TestMergeId",
419  column: x => x.TestMergeId,
420  principalTable: "TestMerges",
421  principalColumn: "Id",
422  onDelete: ReferentialAction.Cascade);
423  });
424 
425  migrationBuilder.CreateIndex(
426  name: "IX_ChatBots_InstanceId",
427  table: "ChatBots",
428  column: "InstanceId");
429 
430  migrationBuilder.CreateIndex(
431  name: "IX_ChatBots_Name",
432  table: "ChatBots",
433  column: "Name",
434  unique: true);
435 
436  migrationBuilder.CreateIndex(
437  name: "IX_ChatChannels_ChatSettingsId_DiscordChannelId",
438  table: "ChatChannels",
439  columns: new[] { "ChatSettingsId", "DiscordChannelId" },
440  unique: true);
441 
442  migrationBuilder.CreateIndex(
443  name: "IX_ChatChannels_ChatSettingsId_IrcChannel",
444  table: "ChatChannels",
445  columns: new[] { "ChatSettingsId", "IrcChannel" },
446  unique: true);
447 
448  migrationBuilder.CreateIndex(
449  name: "IX_CompileJobs_DirectoryName",
450  table: "CompileJobs",
451  column: "DirectoryName");
452 
453  migrationBuilder.CreateIndex(
454  name: "IX_CompileJobs_JobId",
455  table: "CompileJobs",
456  column: "JobId");
457 
458  migrationBuilder.CreateIndex(
459  name: "IX_CompileJobs_RevisionInformationId",
460  table: "CompileJobs",
461  column: "RevisionInformationId");
462 
463  migrationBuilder.CreateIndex(
464  name: "IX_DreamDaemonSettings_InstanceId",
465  table: "DreamDaemonSettings",
466  column: "InstanceId",
467  unique: true);
468 
469  migrationBuilder.CreateIndex(
470  name: "IX_DreamMakerSettings_InstanceId",
471  table: "DreamMakerSettings",
472  column: "InstanceId",
473  unique: true);
474 
475  migrationBuilder.CreateIndex(
476  name: "IX_Instances_Path",
477  table: "Instances",
478  column: "Path",
479  unique: true);
480 
481  migrationBuilder.CreateIndex(
482  name: "IX_Instances_WatchdogReattachInformationId",
483  table: "Instances",
484  column: "WatchdogReattachInformationId");
485 
486  migrationBuilder.CreateIndex(
487  name: "IX_InstanceUsers_InstanceId",
488  table: "InstanceUsers",
489  column: "InstanceId");
490 
491  migrationBuilder.CreateIndex(
492  name: "IX_InstanceUsers_UserId_InstanceId",
493  table: "InstanceUsers",
494  columns: new[] { "UserId", "InstanceId" },
495  unique: true);
496 
497  migrationBuilder.CreateIndex(
498  name: "IX_Jobs_CancelledById",
499  table: "Jobs",
500  column: "CancelledById");
501 
502  migrationBuilder.CreateIndex(
503  name: "IX_Jobs_InstanceId",
504  table: "Jobs",
505  column: "InstanceId");
506 
507  migrationBuilder.CreateIndex(
508  name: "IX_Jobs_StartedById",
509  table: "Jobs",
510  column: "StartedById");
511 
512  migrationBuilder.CreateIndex(
513  name: "IX_ReattachInformations_CompileJobId",
514  table: "ReattachInformations",
515  column: "CompileJobId");
516 
517  migrationBuilder.CreateIndex(
518  name: "IX_RepositorySettings_InstanceId",
519  table: "RepositorySettings",
520  column: "InstanceId",
521  unique: true);
522 
523  migrationBuilder.CreateIndex(
524  name: "IX_RevInfoTestMerges_RevisionInformationId",
525  table: "RevInfoTestMerges",
526  column: "RevisionInformationId");
527 
528  migrationBuilder.CreateIndex(
529  name: "IX_RevInfoTestMerges_TestMergeId",
530  table: "RevInfoTestMerges",
531  column: "TestMergeId");
532 
533  migrationBuilder.CreateIndex(
534  name: "IX_RevisionInformations_CommitSha",
535  table: "RevisionInformations",
536  column: "CommitSha",
537  unique: true);
538 
539  migrationBuilder.CreateIndex(
540  name: "IX_RevisionInformations_InstanceId",
541  table: "RevisionInformations",
542  column: "InstanceId");
543 
544  migrationBuilder.CreateIndex(
545  name: "IX_TestMerges_MergedById",
546  table: "TestMerges",
547  column: "MergedById");
548 
549  migrationBuilder.CreateIndex(
550  name: "IX_TestMerges_PrimaryRevisionInformationId",
551  table: "TestMerges",
552  column: "PrimaryRevisionInformationId",
553  unique: true);
554 
555  migrationBuilder.CreateIndex(
556  name: "IX_Users_CanonicalName",
557  table: "Users",
558  column: "CanonicalName",
559  unique: true);
560 
561  migrationBuilder.CreateIndex(
562  name: "IX_Users_CreatedById",
563  table: "Users",
564  column: "CreatedById");
565 
566  migrationBuilder.CreateIndex(
567  name: "IX_WatchdogReattachInformations_AlphaId",
568  table: "WatchdogReattachInformations",
569  column: "AlphaId");
570 
571  migrationBuilder.CreateIndex(
572  name: "IX_WatchdogReattachInformations_BravoId",
573  table: "WatchdogReattachInformations",
574  column: "BravoId");
575 
576  migrationBuilder.AddForeignKey(
577  name: "FK_ChatChannels_ChatBots_ChatSettingsId",
578  table: "ChatChannels",
579  column: "ChatSettingsId",
580  principalTable: "ChatBots",
581  principalColumn: "Id",
582  onDelete: ReferentialAction.Cascade);
583 
584  migrationBuilder.AddForeignKey(
585  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
586  table: "ReattachInformations",
587  column: "CompileJobId",
588  principalTable: "CompileJobs",
589  principalColumn: "Id",
590  onDelete: ReferentialAction.Restrict);
591  }
592 
597  protected override void Down(MigrationBuilder migrationBuilder)
598  {
599  if (migrationBuilder == null)
600  throw new ArgumentNullException(nameof(migrationBuilder));
601 
602  migrationBuilder.DropForeignKey(
603  name: "FK_Jobs_Instances_InstanceId",
604  table: "Jobs");
605 
606  migrationBuilder.DropForeignKey(
607  name: "FK_RevisionInformations_Instances_InstanceId",
608  table: "RevisionInformations");
609 
610  migrationBuilder.DropTable(
611  name: "ChatChannels");
612 
613  migrationBuilder.DropTable(
614  name: "DreamDaemonSettings");
615 
616  migrationBuilder.DropTable(
617  name: "DreamMakerSettings");
618 
619  migrationBuilder.DropTable(
620  name: "InstanceUsers");
621 
622  migrationBuilder.DropTable(
623  name: "RepositorySettings");
624 
625  migrationBuilder.DropTable(
626  name: "RevInfoTestMerges");
627 
628  migrationBuilder.DropTable(
629  name: "ChatBots");
630 
631  migrationBuilder.DropTable(
632  name: "TestMerges");
633 
634  migrationBuilder.DropTable(
635  name: "Instances");
636 
637  migrationBuilder.DropTable(
638  name: "WatchdogReattachInformations");
639 
640  migrationBuilder.DropTable(
641  name: "ReattachInformations");
642 
643  migrationBuilder.DropTable(
644  name: "CompileJobs");
645 
646  migrationBuilder.DropTable(
647  name: "Jobs");
648 
649  migrationBuilder.DropTable(
650  name: "RevisionInformations");
651 
652  migrationBuilder.DropTable(
653  name: "Users");
654  }
655  }
656 }
ConfigurationRights
Rights for Models.ConfigurationFile
ByondRights
Rights for Models.Byond
Definition: ByondRights.cs:9
InstanceUserRights
Rights for an Models.Instance
- +
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
AdministrationRights
Rights for Models.Administration
ConfigurationType
The type of configuration allowed on an Instance
DreamDaemonRights
Rights for Models.DreamDaemon
InstanceManagerRights
Rights for managing Models.Instances
+
DreamMakerRights
Rights for Models.DreamMaker
-
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
RepositoryRights
Rights for a Models.Repository
- +
ChatBotRights
Rights for Models.ChatBot
Definition: ChatBotRights.cs:9
-
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
+
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
RebootState
Represents the action to take when /world/Reboot() is called
Definition: RebootState.cs:6
diff --git a/20180918020726___m_y_add_minimum_security_8_designer_8cs.html b/20180918020726___m_y_add_minimum_security_8_designer_8cs.html index e54d81ae89..0292705679 100644 --- a/20180918020726___m_y_add_minimum_security_8_designer_8cs.html +++ b/20180918020726___m_y_add_minimum_security_8_designer_8cs.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180918020726_MYAddMinimumSecurity.Designer.cs File Reference +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180918020726_MYAddMinimumSecurity.Designer.cs File Reference @@ -63,7 +63,7 @@ $(function() {
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MYAddMinimumSecurity
 Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel columns for MySQL/MariaDB More...
class  Tgstation.Server.Host.Database.Migrations.MYAddMinimumSecurity
 Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel columns for MySQL/MariaDB More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180918020726___m_y_add_minimum_security_8_designer_8cs_source.html b/20180918020726___m_y_add_minimum_security_8_designer_8cs_source.html index 1bcc0b55d2..dd3fd04bf9 100644 --- a/20180918020726___m_y_add_minimum_security_8_designer_8cs_source.html +++ b/20180918020726___m_y_add_minimum_security_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180918020726_MYAddMinimumSecurity.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180918020726_MYAddMinimumSecurity.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20180918020726_MYAddMinimumSecurity.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
7 
9 {
11  [Migration("20180918020726_MYAddMinimumSecurity")]
12  partial class MYAddMinimumSecurity
13  {
18  protected override void BuildTargetModel(ModelBuilder modelBuilder)
19  {
20 #pragma warning disable 612, 618
21  modelBuilder
22  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
23  .HasAnnotation("Relational:MaxIdentifierLength", 64);
24 
25  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
26  {
27  b.Property<long>("Id")
28  .ValueGeneratedOnAdd();
29 
30  b.Property<string>("ConnectionString")
31  .IsRequired();
32 
33  b.Property<bool?>("Enabled");
34 
35  b.Property<long>("InstanceId");
36 
37  b.Property<string>("Name")
38  .IsRequired();
39 
40  b.Property<int?>("Provider");
41 
42  b.HasKey("Id");
43 
44  b.HasIndex("InstanceId");
45 
46  b.HasIndex("Name")
47  .IsUnique();
48 
49  b.ToTable("ChatBots");
50  });
51 
52  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
53  {
54  b.Property<long>("Id")
55  .ValueGeneratedOnAdd();
56 
57  b.Property<long>("ChatSettingsId");
58 
59  b.Property<ulong?>("DiscordChannelId");
60 
61  b.Property<string>("IrcChannel");
62 
63  b.Property<bool?>("IsAdminChannel")
64  .IsRequired();
65 
66  b.Property<bool?>("IsUpdatesChannel")
67  .IsRequired();
68 
69  b.Property<bool?>("IsWatchdogChannel")
70  .IsRequired();
71 
72  b.Property<string>("Tag");
73 
74  b.HasKey("Id");
75 
76  b.HasIndex("ChatSettingsId", "DiscordChannelId")
77  .IsUnique();
78 
79  b.HasIndex("ChatSettingsId", "IrcChannel")
80  .IsUnique();
81 
82  b.ToTable("ChatChannels");
83  });
84 
85  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
86  {
87  b.Property<long>("Id")
88  .ValueGeneratedOnAdd();
89 
90  b.Property<string>("ByondVersion")
91  .IsRequired();
92 
93  b.Property<Guid?>("DirectoryName");
94 
95  b.Property<string>("DmeName");
96 
97  b.Property<long?>("JobId");
98 
99  b.Property<int>("MinimumSecurityLevel");
100 
101  b.Property<string>("Output");
102 
103  b.Property<long>("RevisionInformationId");
104 
105  b.HasKey("Id");
106 
107  b.HasIndex("DirectoryName");
108 
109  b.HasIndex("JobId");
110 
111  b.HasIndex("RevisionInformationId");
112 
113  b.ToTable("CompileJobs");
114  });
115 
116  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
117  {
118  b.Property<long>("Id")
119  .ValueGeneratedOnAdd();
120 
121  b.Property<string>("AccessToken");
122 
123  b.Property<bool?>("AllowWebClient")
124  .IsRequired();
125 
126  b.Property<bool?>("AutoStart")
127  .IsRequired();
128 
129  b.Property<long>("InstanceId");
130 
131  b.Property<ushort?>("PrimaryPort")
132  .IsRequired();
133 
134  b.Property<int?>("ProcessId");
135 
136  b.Property<ushort?>("SecondaryPort")
137  .IsRequired();
138 
139  b.Property<int>("SecurityLevel");
140 
141  b.Property<bool?>("SoftRestart")
142  .IsRequired();
143 
144  b.Property<bool?>("SoftShutdown")
145  .IsRequired();
146 
147  b.Property<uint?>("StartupTimeout")
148  .IsRequired();
149 
150  b.HasKey("Id");
151 
152  b.HasIndex("InstanceId")
153  .IsUnique();
154 
155  b.ToTable("DreamDaemonSettings");
156  });
157 
158  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
159  {
160  b.Property<long>("Id")
161  .ValueGeneratedOnAdd();
162 
163  b.Property<ushort?>("ApiValidationPort")
164  .IsRequired();
165 
166  b.Property<int>("ApiValidationSecurityLevel");
167 
168  b.Property<long>("InstanceId");
169 
170  b.Property<string>("ProjectName");
171 
172  b.HasKey("Id");
173 
174  b.HasIndex("InstanceId")
175  .IsUnique();
176 
177  b.ToTable("DreamMakerSettings");
178  });
179 
180  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
181  {
182  b.Property<long>("Id")
183  .ValueGeneratedOnAdd();
184 
185  b.Property<uint?>("AutoUpdateInterval")
186  .IsRequired();
187 
188  b.Property<int>("ConfigurationType");
189 
190  b.Property<string>("Name")
191  .IsRequired();
192 
193  b.Property<bool?>("Online")
194  .IsRequired();
195 
196  b.Property<string>("Path")
197  .IsRequired();
198 
199  b.Property<long?>("WatchdogReattachInformationId");
200 
201  b.HasKey("Id");
202 
203  b.HasIndex("Path")
204  .IsUnique();
205 
206  b.HasIndex("WatchdogReattachInformationId");
207 
208  b.ToTable("Instances");
209  });
210 
211  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
212  {
213  b.Property<long>("Id")
214  .ValueGeneratedOnAdd();
215 
216  b.Property<ulong>("ByondRights");
217 
218  b.Property<ulong>("ChatBotRights");
219 
220  b.Property<ulong>("ConfigurationRights");
221 
222  b.Property<ulong>("DreamDaemonRights");
223 
224  b.Property<ulong>("DreamMakerRights");
225 
226  b.Property<long>("InstanceId");
227 
228  b.Property<ulong>("InstanceUserRights");
229 
230  b.Property<ulong>("RepositoryRights");
231 
232  b.Property<long?>("UserId")
233  .IsRequired();
234 
235  b.HasKey("Id");
236 
237  b.HasIndex("InstanceId");
238 
239  b.HasIndex("UserId", "InstanceId")
240  .IsUnique();
241 
242  b.ToTable("InstanceUsers");
243  });
244 
245  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
246  {
247  b.Property<long>("Id")
248  .ValueGeneratedOnAdd();
249 
250  b.Property<ulong?>("CancelRight");
251 
252  b.Property<ulong?>("CancelRightsType");
253 
254  b.Property<bool?>("Cancelled")
255  .IsRequired();
256 
257  b.Property<long?>("CancelledById");
258 
259  b.Property<string>("Description")
260  .IsRequired();
261 
262  b.Property<string>("ExceptionDetails");
263 
264  b.Property<long>("InstanceId");
265 
266  b.Property<DateTimeOffset?>("StartedAt")
267  .IsRequired();
268 
269  b.Property<long>("StartedById");
270 
271  b.Property<DateTimeOffset?>("StoppedAt");
272 
273  b.HasKey("Id");
274 
275  b.HasIndex("CancelledById");
276 
277  b.HasIndex("InstanceId");
278 
279  b.HasIndex("StartedById");
280 
281  b.ToTable("Jobs");
282  });
283 
284  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
285  {
286  b.Property<long>("Id")
287  .ValueGeneratedOnAdd();
288 
289  b.Property<string>("AccessIdentifier")
290  .IsRequired();
291 
292  b.Property<string>("ChatChannelsJson")
293  .IsRequired();
294 
295  b.Property<string>("ChatCommandsJson")
296  .IsRequired();
297 
298  b.Property<long?>("CompileJobId");
299 
300  b.Property<bool>("IsPrimary");
301 
302  b.Property<ushort>("Port");
303 
304  b.Property<int>("ProcessId");
305 
306  b.Property<int>("RebootState");
307 
308  b.Property<string>("ServerCommandsJson")
309  .IsRequired();
310 
311  b.HasKey("Id");
312 
313  b.HasIndex("CompileJobId");
314 
315  b.ToTable("ReattachInformations");
316  });
317 
318  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
319  {
320  b.Property<long>("Id")
321  .ValueGeneratedOnAdd();
322 
323  b.Property<string>("AccessToken");
324 
325  b.Property<string>("AccessUser");
326 
327  b.Property<bool?>("AutoUpdatesKeepTestMerges")
328  .IsRequired();
329 
330  b.Property<bool?>("AutoUpdatesSynchronize")
331  .IsRequired();
332 
333  b.Property<string>("CommitterEmail")
334  .IsRequired();
335 
336  b.Property<string>("CommitterName")
337  .IsRequired();
338 
339  b.Property<long>("InstanceId");
340 
341  b.Property<bool?>("PushTestMergeCommits")
342  .IsRequired();
343 
344  b.Property<bool?>("ShowTestMergeCommitters")
345  .IsRequired();
346 
347  b.HasKey("Id");
348 
349  b.HasIndex("InstanceId")
350  .IsUnique();
351 
352  b.ToTable("RepositorySettings");
353  });
354 
355  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
356  {
357  b.Property<long>("Id")
358  .ValueGeneratedOnAdd();
359 
360  b.Property<long>("RevisionInformationId");
361 
362  b.Property<long>("TestMergeId");
363 
364  b.HasKey("Id");
365 
366  b.HasIndex("RevisionInformationId");
367 
368  b.HasIndex("TestMergeId");
369 
370  b.ToTable("RevInfoTestMerges");
371  });
372 
373  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
374  {
375  b.Property<long>("Id")
376  .ValueGeneratedOnAdd();
377 
378  b.Property<string>("CommitSha")
379  .IsRequired()
380  .HasMaxLength(40);
381 
382  b.Property<long>("InstanceId");
383 
384  b.Property<string>("OriginCommitSha")
385  .IsRequired()
386  .HasMaxLength(40);
387 
388  b.HasKey("Id");
389 
390  b.HasIndex("CommitSha")
391  .IsUnique();
392 
393  b.HasIndex("InstanceId");
394 
395  b.ToTable("RevisionInformations");
396  });
397 
398  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
399  {
400  b.Property<long>("Id")
401  .ValueGeneratedOnAdd();
402 
403  b.Property<string>("Author")
404  .IsRequired();
405 
406  b.Property<string>("BodyAtMerge")
407  .IsRequired();
408 
409  b.Property<string>("Comment");
410 
411  b.Property<DateTimeOffset>("MergedAt");
412 
413  b.Property<long>("MergedById");
414 
415  b.Property<int?>("Number")
416  .IsRequired();
417 
418  b.Property<long?>("PrimaryRevisionInformationId");
419 
420  b.Property<string>("PullRequestRevision")
421  .IsRequired();
422 
423  b.Property<string>("TitleAtMerge")
424  .IsRequired();
425 
426  b.Property<string>("Url")
427  .IsRequired();
428 
429  b.HasKey("Id");
430 
431  b.HasIndex("MergedById");
432 
433  b.HasIndex("PrimaryRevisionInformationId")
434  .IsUnique();
435 
436  b.ToTable("TestMerges");
437  });
438 
439  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
440  {
441  b.Property<long>("Id")
442  .ValueGeneratedOnAdd();
443 
444  b.Property<ulong>("AdministrationRights");
445 
446  b.Property<string>("CanonicalName")
447  .IsRequired();
448 
449  b.Property<DateTimeOffset?>("CreatedAt")
450  .IsRequired();
451 
452  b.Property<long?>("CreatedById");
453 
454  b.Property<bool?>("Enabled")
455  .IsRequired();
456 
457  b.Property<ulong>("InstanceManagerRights");
458 
459  b.Property<DateTimeOffset?>("LastPasswordUpdate");
460 
461  b.Property<string>("Name")
462  .IsRequired();
463 
464  b.Property<string>("PasswordHash");
465 
466  b.Property<string>("SystemIdentifier");
467 
468  b.HasKey("Id");
469 
470  b.HasIndex("CanonicalName")
471  .IsUnique();
472 
473  b.HasIndex("CreatedById");
474 
475  b.ToTable("Users");
476  });
477 
478  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
479  {
480  b.Property<long>("Id")
481  .ValueGeneratedOnAdd();
482 
483  b.Property<long?>("AlphaId");
484 
485  b.Property<bool>("AlphaIsActive");
486 
487  b.Property<long?>("BravoId");
488 
489  b.HasKey("Id");
490 
491  b.HasIndex("AlphaId");
492 
493  b.HasIndex("BravoId");
494 
495  b.ToTable("WatchdogReattachInformations");
496  });
497 
498  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
499  {
500  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
501  .WithMany("ChatSettings")
502  .HasForeignKey("InstanceId")
503  .OnDelete(DeleteBehavior.Cascade);
504  });
505 
506  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
507  {
508  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
509  .WithMany("Channels")
510  .HasForeignKey("ChatSettingsId")
511  .OnDelete(DeleteBehavior.Cascade);
512  });
513 
514  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
515  {
516  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
517  .WithMany()
518  .HasForeignKey("JobId");
519 
520  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
521  .WithMany("CompileJobs")
522  .HasForeignKey("RevisionInformationId")
523  .OnDelete(DeleteBehavior.Cascade);
524  });
525 
526  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
527  {
528  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
529  .WithOne("DreamDaemonSettings")
530  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
531  .OnDelete(DeleteBehavior.Cascade);
532  });
533 
534  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
535  {
536  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
537  .WithOne("DreamMakerSettings")
538  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
539  .OnDelete(DeleteBehavior.Cascade);
540  });
541 
542  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
543  {
544  b.HasOne("Tgstation.Server.Host.Models.WatchdogReattachInformation", "WatchdogReattachInformation")
545  .WithMany()
546  .HasForeignKey("WatchdogReattachInformationId");
547  });
548 
549  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
550  {
551  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
552  .WithMany("InstanceUsers")
553  .HasForeignKey("InstanceId")
554  .OnDelete(DeleteBehavior.Cascade);
555 
556  b.HasOne("Tgstation.Server.Host.Models.User")
557  .WithMany("InstanceUsers")
558  .HasForeignKey("UserId")
559  .OnDelete(DeleteBehavior.Cascade);
560  });
561 
562  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
563  {
564  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
565  .WithMany()
566  .HasForeignKey("CancelledById");
567 
568  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
569  .WithMany("Jobs")
570  .HasForeignKey("InstanceId")
571  .OnDelete(DeleteBehavior.Cascade);
572 
573  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
574  .WithMany()
575  .HasForeignKey("StartedById")
576  .OnDelete(DeleteBehavior.Cascade);
577  });
578 
579  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
580  {
581  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
582  .WithMany()
583  .HasForeignKey("CompileJobId");
584  });
585 
586  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
587  {
588  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
589  .WithOne("RepositorySettings")
590  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
591  .OnDelete(DeleteBehavior.Cascade);
592  });
593 
594  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
595  {
596  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
597  .WithMany("ActiveTestMerges")
598  .HasForeignKey("RevisionInformationId")
599  .OnDelete(DeleteBehavior.Cascade);
600 
601  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
602  .WithMany("RevisonInformations")
603  .HasForeignKey("TestMergeId")
604  .OnDelete(DeleteBehavior.Cascade);
605  });
606 
607  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
608  {
609  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
610  .WithMany("RevisionInformations")
611  .HasForeignKey("InstanceId")
612  .OnDelete(DeleteBehavior.Cascade);
613  });
614 
615  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
616  {
617  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
618  .WithMany("TestMerges")
619  .HasForeignKey("MergedById")
620  .OnDelete(DeleteBehavior.Restrict);
621 
622  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
623  .WithOne("PrimaryTestMerge")
624  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
625  .OnDelete(DeleteBehavior.SetNull);
626  });
627 
628  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
629  {
630  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
631  .WithMany("CreatedUsers")
632  .HasForeignKey("CreatedById");
633  });
634 
635  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
636  {
637  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
638  .WithMany()
639  .HasForeignKey("AlphaId");
640 
641  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
642  .WithMany()
643  .HasForeignKey("BravoId");
644  });
645 #pragma warning restore 612, 618
646  }
647  }
648 }
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
- - +Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
6 
8 {
9  [DbContext(typeof(MySqlDatabaseContext))]
10  [Migration("20180918020726_MYAddMinimumSecurity")]
11  partial class MYAddMinimumSecurity
12  {
17  protected override void BuildTargetModel(ModelBuilder modelBuilder)
18  {
19 #pragma warning disable 612, 618
20  modelBuilder
21  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
22  .HasAnnotation("Relational:MaxIdentifierLength", 64);
23 
24  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
25  {
26  b.Property<long>("Id")
27  .ValueGeneratedOnAdd();
28 
29  b.Property<string>("ConnectionString")
30  .IsRequired();
31 
32  b.Property<bool?>("Enabled");
33 
34  b.Property<long>("InstanceId");
35 
36  b.Property<string>("Name")
37  .IsRequired();
38 
39  b.Property<int?>("Provider");
40 
41  b.HasKey("Id");
42 
43  b.HasIndex("InstanceId");
44 
45  b.HasIndex("Name")
46  .IsUnique();
47 
48  b.ToTable("ChatBots");
49  });
50 
51  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
52  {
53  b.Property<long>("Id")
54  .ValueGeneratedOnAdd();
55 
56  b.Property<long>("ChatSettingsId");
57 
58  b.Property<ulong?>("DiscordChannelId");
59 
60  b.Property<string>("IrcChannel");
61 
62  b.Property<bool?>("IsAdminChannel")
63  .IsRequired();
64 
65  b.Property<bool?>("IsUpdatesChannel")
66  .IsRequired();
67 
68  b.Property<bool?>("IsWatchdogChannel")
69  .IsRequired();
70 
71  b.Property<string>("Tag");
72 
73  b.HasKey("Id");
74 
75  b.HasIndex("ChatSettingsId", "DiscordChannelId")
76  .IsUnique();
77 
78  b.HasIndex("ChatSettingsId", "IrcChannel")
79  .IsUnique();
80 
81  b.ToTable("ChatChannels");
82  });
83 
84  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
85  {
86  b.Property<long>("Id")
87  .ValueGeneratedOnAdd();
88 
89  b.Property<string>("ByondVersion")
90  .IsRequired();
91 
92  b.Property<Guid?>("DirectoryName");
93 
94  b.Property<string>("DmeName");
95 
96  b.Property<long?>("JobId");
97 
98  b.Property<int>("MinimumSecurityLevel");
99 
100  b.Property<string>("Output");
101 
102  b.Property<long>("RevisionInformationId");
103 
104  b.HasKey("Id");
105 
106  b.HasIndex("DirectoryName");
107 
108  b.HasIndex("JobId");
109 
110  b.HasIndex("RevisionInformationId");
111 
112  b.ToTable("CompileJobs");
113  });
114 
115  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
116  {
117  b.Property<long>("Id")
118  .ValueGeneratedOnAdd();
119 
120  b.Property<string>("AccessToken");
121 
122  b.Property<bool?>("AllowWebClient")
123  .IsRequired();
124 
125  b.Property<bool?>("AutoStart")
126  .IsRequired();
127 
128  b.Property<long>("InstanceId");
129 
130  b.Property<ushort?>("PrimaryPort")
131  .IsRequired();
132 
133  b.Property<int?>("ProcessId");
134 
135  b.Property<ushort?>("SecondaryPort")
136  .IsRequired();
137 
138  b.Property<int>("SecurityLevel");
139 
140  b.Property<bool?>("SoftRestart")
141  .IsRequired();
142 
143  b.Property<bool?>("SoftShutdown")
144  .IsRequired();
145 
146  b.Property<uint?>("StartupTimeout")
147  .IsRequired();
148 
149  b.HasKey("Id");
150 
151  b.HasIndex("InstanceId")
152  .IsUnique();
153 
154  b.ToTable("DreamDaemonSettings");
155  });
156 
157  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
158  {
159  b.Property<long>("Id")
160  .ValueGeneratedOnAdd();
161 
162  b.Property<ushort?>("ApiValidationPort")
163  .IsRequired();
164 
165  b.Property<int>("ApiValidationSecurityLevel");
166 
167  b.Property<long>("InstanceId");
168 
169  b.Property<string>("ProjectName");
170 
171  b.HasKey("Id");
172 
173  b.HasIndex("InstanceId")
174  .IsUnique();
175 
176  b.ToTable("DreamMakerSettings");
177  });
178 
179  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
180  {
181  b.Property<long>("Id")
182  .ValueGeneratedOnAdd();
183 
184  b.Property<uint?>("AutoUpdateInterval")
185  .IsRequired();
186 
187  b.Property<int>("ConfigurationType");
188 
189  b.Property<string>("Name")
190  .IsRequired();
191 
192  b.Property<bool?>("Online")
193  .IsRequired();
194 
195  b.Property<string>("Path")
196  .IsRequired();
197 
198  b.Property<long?>("WatchdogReattachInformationId");
199 
200  b.HasKey("Id");
201 
202  b.HasIndex("Path")
203  .IsUnique();
204 
205  b.HasIndex("WatchdogReattachInformationId");
206 
207  b.ToTable("Instances");
208  });
209 
210  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
211  {
212  b.Property<long>("Id")
213  .ValueGeneratedOnAdd();
214 
215  b.Property<ulong>("ByondRights");
216 
217  b.Property<ulong>("ChatBotRights");
218 
219  b.Property<ulong>("ConfigurationRights");
220 
221  b.Property<ulong>("DreamDaemonRights");
222 
223  b.Property<ulong>("DreamMakerRights");
224 
225  b.Property<long>("InstanceId");
226 
227  b.Property<ulong>("InstanceUserRights");
228 
229  b.Property<ulong>("RepositoryRights");
230 
231  b.Property<long?>("UserId")
232  .IsRequired();
233 
234  b.HasKey("Id");
235 
236  b.HasIndex("InstanceId");
237 
238  b.HasIndex("UserId", "InstanceId")
239  .IsUnique();
240 
241  b.ToTable("InstanceUsers");
242  });
243 
244  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
245  {
246  b.Property<long>("Id")
247  .ValueGeneratedOnAdd();
248 
249  b.Property<ulong?>("CancelRight");
250 
251  b.Property<ulong?>("CancelRightsType");
252 
253  b.Property<bool?>("Cancelled")
254  .IsRequired();
255 
256  b.Property<long?>("CancelledById");
257 
258  b.Property<string>("Description")
259  .IsRequired();
260 
261  b.Property<string>("ExceptionDetails");
262 
263  b.Property<long>("InstanceId");
264 
265  b.Property<DateTimeOffset?>("StartedAt")
266  .IsRequired();
267 
268  b.Property<long>("StartedById");
269 
270  b.Property<DateTimeOffset?>("StoppedAt");
271 
272  b.HasKey("Id");
273 
274  b.HasIndex("CancelledById");
275 
276  b.HasIndex("InstanceId");
277 
278  b.HasIndex("StartedById");
279 
280  b.ToTable("Jobs");
281  });
282 
283  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
284  {
285  b.Property<long>("Id")
286  .ValueGeneratedOnAdd();
287 
288  b.Property<string>("AccessIdentifier")
289  .IsRequired();
290 
291  b.Property<string>("ChatChannelsJson")
292  .IsRequired();
293 
294  b.Property<string>("ChatCommandsJson")
295  .IsRequired();
296 
297  b.Property<long?>("CompileJobId");
298 
299  b.Property<bool>("IsPrimary");
300 
301  b.Property<ushort>("Port");
302 
303  b.Property<int>("ProcessId");
304 
305  b.Property<int>("RebootState");
306 
307  b.Property<string>("ServerCommandsJson")
308  .IsRequired();
309 
310  b.HasKey("Id");
311 
312  b.HasIndex("CompileJobId");
313 
314  b.ToTable("ReattachInformations");
315  });
316 
317  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
318  {
319  b.Property<long>("Id")
320  .ValueGeneratedOnAdd();
321 
322  b.Property<string>("AccessToken");
323 
324  b.Property<string>("AccessUser");
325 
326  b.Property<bool?>("AutoUpdatesKeepTestMerges")
327  .IsRequired();
328 
329  b.Property<bool?>("AutoUpdatesSynchronize")
330  .IsRequired();
331 
332  b.Property<string>("CommitterEmail")
333  .IsRequired();
334 
335  b.Property<string>("CommitterName")
336  .IsRequired();
337 
338  b.Property<long>("InstanceId");
339 
340  b.Property<bool?>("PushTestMergeCommits")
341  .IsRequired();
342 
343  b.Property<bool?>("ShowTestMergeCommitters")
344  .IsRequired();
345 
346  b.HasKey("Id");
347 
348  b.HasIndex("InstanceId")
349  .IsUnique();
350 
351  b.ToTable("RepositorySettings");
352  });
353 
354  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
355  {
356  b.Property<long>("Id")
357  .ValueGeneratedOnAdd();
358 
359  b.Property<long>("RevisionInformationId");
360 
361  b.Property<long>("TestMergeId");
362 
363  b.HasKey("Id");
364 
365  b.HasIndex("RevisionInformationId");
366 
367  b.HasIndex("TestMergeId");
368 
369  b.ToTable("RevInfoTestMerges");
370  });
371 
372  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
373  {
374  b.Property<long>("Id")
375  .ValueGeneratedOnAdd();
376 
377  b.Property<string>("CommitSha")
378  .IsRequired()
379  .HasMaxLength(40);
380 
381  b.Property<long>("InstanceId");
382 
383  b.Property<string>("OriginCommitSha")
384  .IsRequired()
385  .HasMaxLength(40);
386 
387  b.HasKey("Id");
388 
389  b.HasIndex("CommitSha")
390  .IsUnique();
391 
392  b.HasIndex("InstanceId");
393 
394  b.ToTable("RevisionInformations");
395  });
396 
397  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
398  {
399  b.Property<long>("Id")
400  .ValueGeneratedOnAdd();
401 
402  b.Property<string>("Author")
403  .IsRequired();
404 
405  b.Property<string>("BodyAtMerge")
406  .IsRequired();
407 
408  b.Property<string>("Comment");
409 
410  b.Property<DateTimeOffset>("MergedAt");
411 
412  b.Property<long>("MergedById");
413 
414  b.Property<int?>("Number")
415  .IsRequired();
416 
417  b.Property<long?>("PrimaryRevisionInformationId");
418 
419  b.Property<string>("PullRequestRevision")
420  .IsRequired();
421 
422  b.Property<string>("TitleAtMerge")
423  .IsRequired();
424 
425  b.Property<string>("Url")
426  .IsRequired();
427 
428  b.HasKey("Id");
429 
430  b.HasIndex("MergedById");
431 
432  b.HasIndex("PrimaryRevisionInformationId")
433  .IsUnique();
434 
435  b.ToTable("TestMerges");
436  });
437 
438  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
439  {
440  b.Property<long>("Id")
441  .ValueGeneratedOnAdd();
442 
443  b.Property<ulong>("AdministrationRights");
444 
445  b.Property<string>("CanonicalName")
446  .IsRequired();
447 
448  b.Property<DateTimeOffset?>("CreatedAt")
449  .IsRequired();
450 
451  b.Property<long?>("CreatedById");
452 
453  b.Property<bool?>("Enabled")
454  .IsRequired();
455 
456  b.Property<ulong>("InstanceManagerRights");
457 
458  b.Property<DateTimeOffset?>("LastPasswordUpdate");
459 
460  b.Property<string>("Name")
461  .IsRequired();
462 
463  b.Property<string>("PasswordHash");
464 
465  b.Property<string>("SystemIdentifier");
466 
467  b.HasKey("Id");
468 
469  b.HasIndex("CanonicalName")
470  .IsUnique();
471 
472  b.HasIndex("CreatedById");
473 
474  b.ToTable("Users");
475  });
476 
477  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
478  {
479  b.Property<long>("Id")
480  .ValueGeneratedOnAdd();
481 
482  b.Property<long?>("AlphaId");
483 
484  b.Property<bool>("AlphaIsActive");
485 
486  b.Property<long?>("BravoId");
487 
488  b.HasKey("Id");
489 
490  b.HasIndex("AlphaId");
491 
492  b.HasIndex("BravoId");
493 
494  b.ToTable("WatchdogReattachInformations");
495  });
496 
497  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
498  {
499  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
500  .WithMany("ChatSettings")
501  .HasForeignKey("InstanceId")
502  .OnDelete(DeleteBehavior.Cascade);
503  });
504 
505  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
506  {
507  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
508  .WithMany("Channels")
509  .HasForeignKey("ChatSettingsId")
510  .OnDelete(DeleteBehavior.Cascade);
511  });
512 
513  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
514  {
515  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
516  .WithMany()
517  .HasForeignKey("JobId");
518 
519  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
520  .WithMany("CompileJobs")
521  .HasForeignKey("RevisionInformationId")
522  .OnDelete(DeleteBehavior.Cascade);
523  });
524 
525  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
526  {
527  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
528  .WithOne("DreamDaemonSettings")
529  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
530  .OnDelete(DeleteBehavior.Cascade);
531  });
532 
533  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
534  {
535  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
536  .WithOne("DreamMakerSettings")
537  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
538  .OnDelete(DeleteBehavior.Cascade);
539  });
540 
541  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
542  {
543  b.HasOne("Tgstation.Server.Host.Models.WatchdogReattachInformation", "WatchdogReattachInformation")
544  .WithMany()
545  .HasForeignKey("WatchdogReattachInformationId");
546  });
547 
548  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
549  {
550  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
551  .WithMany("InstanceUsers")
552  .HasForeignKey("InstanceId")
553  .OnDelete(DeleteBehavior.Cascade);
554 
555  b.HasOne("Tgstation.Server.Host.Models.User")
556  .WithMany("InstanceUsers")
557  .HasForeignKey("UserId")
558  .OnDelete(DeleteBehavior.Cascade);
559  });
560 
561  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
562  {
563  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
564  .WithMany()
565  .HasForeignKey("CancelledById");
566 
567  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
568  .WithMany("Jobs")
569  .HasForeignKey("InstanceId")
570  .OnDelete(DeleteBehavior.Cascade);
571 
572  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
573  .WithMany()
574  .HasForeignKey("StartedById")
575  .OnDelete(DeleteBehavior.Cascade);
576  });
577 
578  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
579  {
580  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
581  .WithMany()
582  .HasForeignKey("CompileJobId");
583  });
584 
585  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
586  {
587  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
588  .WithOne("RepositorySettings")
589  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
590  .OnDelete(DeleteBehavior.Cascade);
591  });
592 
593  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
594  {
595  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
596  .WithMany("ActiveTestMerges")
597  .HasForeignKey("RevisionInformationId")
598  .OnDelete(DeleteBehavior.Cascade);
599 
600  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
601  .WithMany("RevisonInformations")
602  .HasForeignKey("TestMergeId")
603  .OnDelete(DeleteBehavior.Cascade);
604  });
605 
606  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
607  {
608  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
609  .WithMany("RevisionInformations")
610  .HasForeignKey("InstanceId")
611  .OnDelete(DeleteBehavior.Cascade);
612  });
613 
614  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
615  {
616  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
617  .WithMany("TestMerges")
618  .HasForeignKey("MergedById")
619  .OnDelete(DeleteBehavior.Restrict);
620 
621  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
622  .WithOne("PrimaryTestMerge")
623  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
624  .OnDelete(DeleteBehavior.SetNull);
625  });
626 
627  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
628  {
629  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
630  .WithMany("CreatedUsers")
631  .HasForeignKey("CreatedById");
632  });
633 
634  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
635  {
636  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
637  .WithMany()
638  .HasForeignKey("AlphaId");
639 
640  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
641  .WithMany()
642  .HasForeignKey("BravoId");
643  });
644 #pragma warning restore 612, 618
645  }
646  }
647 }
-
DatabaseContext<TParentContext> for MySQL
- - - - +
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
+
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MYAddMinimumSecurity
 Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel columns for MySQL/MariaDB More...
class  Tgstation.Server.Host.Database.Migrations.MYAddMinimumSecurity
 Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel columns for MySQL/MariaDB More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180918020726___m_y_add_minimum_security_8cs_source.html b/20180918020726___m_y_add_minimum_security_8cs_source.html index 88ebe51022..239a61e6e4 100644 --- a/20180918020726___m_y_add_minimum_security_8cs_source.html +++ b/20180918020726___m_y_add_minimum_security_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180918020726_MYAddMinimumSecurity.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180918020726_MYAddMinimumSecurity.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,16 +71,16 @@ $(function() {
20180918020726_MYAddMinimumSecurity.cs
-Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
4 
6 {
10  public partial class MYAddMinimumSecurity : Migration
11  {
16  protected override void Up(MigrationBuilder migrationBuilder)
17  {
18  if (migrationBuilder == null)
19  throw new ArgumentNullException(nameof(migrationBuilder));
20 
21  migrationBuilder.AddColumn<int>(
22  name: "ApiValidationSecurityLevel",
23  table: "DreamMakerSettings",
24  nullable: false,
25  defaultValue: (int)DreamDaemonSecurity.Safe);
26 
27  migrationBuilder.AddColumn<int>(
28  name: "MinimumSecurityLevel",
29  table: "CompileJobs",
30  nullable: false,
31  defaultValue: (int)DreamDaemonSecurity.Safe);
32  }
33 
38  protected override void Down(MigrationBuilder migrationBuilder)
39  {
40  if (migrationBuilder == null)
41  throw new ArgumentNullException(nameof(migrationBuilder));
42 
43  migrationBuilder.DropColumn(
44  name: "ApiValidationSecurityLevel",
45  table: "DreamMakerSettings");
46 
47  migrationBuilder.DropColumn(
48  name: "MinimumSecurityLevel",
49  table: "CompileJobs");
50  }
51  }
52 }
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
- - -
Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel...
+Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
4 
6 {
10  public partial class MYAddMinimumSecurity : Migration
11  {
16  protected override void Up(MigrationBuilder migrationBuilder)
17  {
18  if (migrationBuilder == null)
19  throw new ArgumentNullException(nameof(migrationBuilder));
20 
21  migrationBuilder.AddColumn<int>(
22  name: "ApiValidationSecurityLevel",
23  table: "DreamMakerSettings",
24  nullable: false,
25  defaultValue: (int)DreamDaemonSecurity.Safe);
26 
27  migrationBuilder.AddColumn<int>(
28  name: "MinimumSecurityLevel",
29  table: "CompileJobs",
30  nullable: false,
31  defaultValue: (int)DreamDaemonSecurity.Safe);
32  }
33 
38  protected override void Down(MigrationBuilder migrationBuilder)
39  {
40  if (migrationBuilder == null)
41  throw new ArgumentNullException(nameof(migrationBuilder));
42 
43  migrationBuilder.DropColumn(
44  name: "ApiValidationSecurityLevel",
45  table: "DreamMakerSettings");
46 
47  migrationBuilder.DropColumn(
48  name: "MinimumSecurityLevel",
49  table: "CompileJobs");
50  }
51  }
52 }
+
Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel...
+
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
+
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
+
DreamDaemonSecurity
DreamDaemon's security level
-
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MSAddMinimumSecurity
 Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel columns for MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MSAddMinimumSecurity
 Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel columns for MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180918021228___m_s_add_minimum_security_8_designer_8cs_source.html b/20180918021228___m_s_add_minimum_security_8_designer_8cs_source.html index 4e2790fb7f..e5de9dc8f7 100644 --- a/20180918021228___m_s_add_minimum_security_8_designer_8cs_source.html +++ b/20180918021228___m_s_add_minimum_security_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180918021228_MSAddMinimumSecurity.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180918021228_MSAddMinimumSecurity.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20180918021228_MSAddMinimumSecurity.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
9 
11 {
13  [Migration("20180918021228_MSAddMinimumSecurity")]
14  partial class MSAddMinimumSecurity
15  {
20  protected override void BuildTargetModel(ModelBuilder modelBuilder)
21  {
22 #pragma warning disable 612, 618
23  modelBuilder
24  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
25  .HasAnnotation("Relational:MaxIdentifierLength", 128)
26  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
27 
28  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
29  {
30  b.Property<long>("Id")
31  .ValueGeneratedOnAdd()
32  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
33 
34  b.Property<string>("ConnectionString")
35  .IsRequired();
36 
37  b.Property<bool?>("Enabled");
38 
39  b.Property<long>("InstanceId");
40 
41  b.Property<string>("Name")
42  .IsRequired();
43 
44  b.Property<int?>("Provider");
45 
46  b.HasKey("Id");
47 
48  b.HasIndex("InstanceId");
49 
50  b.HasIndex("Name")
51  .IsUnique();
52 
53  b.ToTable("ChatBots");
54  });
55 
56  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
57  {
58  b.Property<long>("Id")
59  .ValueGeneratedOnAdd()
60  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
61 
62  b.Property<long>("ChatSettingsId");
63 
64  b.Property<decimal?>("DiscordChannelId")
65  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
66 
67  b.Property<string>("IrcChannel");
68 
69  b.Property<bool?>("IsAdminChannel")
70  .IsRequired();
71 
72  b.Property<bool?>("IsUpdatesChannel")
73  .IsRequired();
74 
75  b.Property<bool?>("IsWatchdogChannel")
76  .IsRequired();
77 
78  b.Property<string>("Tag");
79 
80  b.HasKey("Id");
81 
82  b.HasIndex("ChatSettingsId", "DiscordChannelId")
83  .IsUnique()
84  .HasFilter("[DiscordChannelId] IS NOT NULL");
85 
86  b.HasIndex("ChatSettingsId", "IrcChannel")
87  .IsUnique()
88  .HasFilter("[IrcChannel] IS NOT NULL");
89 
90  b.ToTable("ChatChannels");
91  });
92 
93  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
94  {
95  b.Property<long>("Id")
96  .ValueGeneratedOnAdd()
97  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
98 
99  b.Property<string>("ByondVersion")
100  .IsRequired();
101 
102  b.Property<Guid?>("DirectoryName");
103 
104  b.Property<string>("DmeName");
105 
106  b.Property<long?>("JobId");
107 
108  b.Property<int>("MinimumSecurityLevel");
109 
110  b.Property<string>("Output");
111 
112  b.Property<long>("RevisionInformationId");
113 
114  b.HasKey("Id");
115 
116  b.HasIndex("DirectoryName");
117 
118  b.HasIndex("JobId");
119 
120  b.HasIndex("RevisionInformationId");
121 
122  b.ToTable("CompileJobs");
123  });
124 
125  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
126  {
127  b.Property<long>("Id")
128  .ValueGeneratedOnAdd()
129  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
130 
131  b.Property<string>("AccessToken");
132 
133  b.Property<bool?>("AllowWebClient")
134  .IsRequired();
135 
136  b.Property<bool?>("AutoStart")
137  .IsRequired();
138 
139  b.Property<long>("InstanceId");
140 
141  b.Property<int>("PrimaryPort");
142 
143  b.Property<int?>("ProcessId");
144 
145  b.Property<int>("SecondaryPort");
146 
147  b.Property<int>("SecurityLevel");
148 
149  b.Property<bool?>("SoftRestart")
150  .IsRequired();
151 
152  b.Property<bool?>("SoftShutdown")
153  .IsRequired();
154 
155  b.Property<long>("StartupTimeout");
156 
157  b.HasKey("Id");
158 
159  b.HasIndex("InstanceId")
160  .IsUnique();
161 
162  b.ToTable("DreamDaemonSettings");
163  });
164 
165  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
166  {
167  b.Property<long>("Id")
168  .ValueGeneratedOnAdd()
169  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
170 
171  b.Property<int>("ApiValidationPort");
172 
173  b.Property<int>("ApiValidationSecurityLevel");
174 
175  b.Property<long>("InstanceId");
176 
177  b.Property<string>("ProjectName");
178 
179  b.HasKey("Id");
180 
181  b.HasIndex("InstanceId")
182  .IsUnique();
183 
184  b.ToTable("DreamMakerSettings");
185  });
186 
187  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
188  {
189  b.Property<long>("Id")
190  .ValueGeneratedOnAdd()
191  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
192 
193  b.Property<long>("AutoUpdateInterval");
194 
195  b.Property<int>("ConfigurationType");
196 
197  b.Property<string>("Name")
198  .IsRequired();
199 
200  b.Property<bool?>("Online")
201  .IsRequired();
202 
203  b.Property<string>("Path")
204  .IsRequired();
205 
206  b.Property<long?>("WatchdogReattachInformationId");
207 
208  b.HasKey("Id");
209 
210  b.HasIndex("Path")
211  .IsUnique();
212 
213  b.HasIndex("WatchdogReattachInformationId");
214 
215  b.ToTable("Instances");
216  });
217 
218  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
219  {
220  b.Property<long>("Id")
221  .ValueGeneratedOnAdd()
222  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
223 
224  b.Property<decimal>("ByondRights")
225  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
226 
227  b.Property<decimal>("ChatBotRights")
228  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
229 
230  b.Property<decimal>("ConfigurationRights")
231  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
232 
233  b.Property<decimal>("DreamDaemonRights")
234  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
235 
236  b.Property<decimal>("DreamMakerRights")
237  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
238 
239  b.Property<long>("InstanceId");
240 
241  b.Property<decimal>("InstanceUserRights")
242  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
243 
244  b.Property<decimal>("RepositoryRights")
245  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
246 
247  b.Property<long?>("UserId")
248  .IsRequired();
249 
250  b.HasKey("Id");
251 
252  b.HasIndex("InstanceId");
253 
254  b.HasIndex("UserId", "InstanceId")
255  .IsUnique();
256 
257  b.ToTable("InstanceUsers");
258  });
259 
260  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
261  {
262  b.Property<long>("Id")
263  .ValueGeneratedOnAdd()
264  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
265 
266  b.Property<decimal?>("CancelRight")
267  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
268 
269  b.Property<decimal?>("CancelRightsType")
270  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
271 
272  b.Property<bool?>("Cancelled")
273  .IsRequired();
274 
275  b.Property<long?>("CancelledById");
276 
277  b.Property<string>("Description")
278  .IsRequired();
279 
280  b.Property<string>("ExceptionDetails");
281 
282  b.Property<long>("InstanceId");
283 
284  b.Property<DateTimeOffset?>("StartedAt")
285  .IsRequired();
286 
287  b.Property<long>("StartedById");
288 
289  b.Property<DateTimeOffset?>("StoppedAt");
290 
291  b.HasKey("Id");
292 
293  b.HasIndex("CancelledById");
294 
295  b.HasIndex("InstanceId");
296 
297  b.HasIndex("StartedById");
298 
299  b.ToTable("Jobs");
300  });
301 
302  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
303  {
304  b.Property<long>("Id")
305  .ValueGeneratedOnAdd()
306  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
307 
308  b.Property<string>("AccessIdentifier")
309  .IsRequired();
310 
311  b.Property<string>("ChatChannelsJson")
312  .IsRequired();
313 
314  b.Property<string>("ChatCommandsJson")
315  .IsRequired();
316 
317  b.Property<long?>("CompileJobId");
318 
319  b.Property<bool>("IsPrimary");
320 
321  b.Property<int>("Port");
322 
323  b.Property<int>("ProcessId");
324 
325  b.Property<int>("RebootState");
326 
327  b.Property<string>("ServerCommandsJson")
328  .IsRequired();
329 
330  b.HasKey("Id");
331 
332  b.HasIndex("CompileJobId");
333 
334  b.ToTable("ReattachInformations");
335  });
336 
337  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
338  {
339  b.Property<long>("Id")
340  .ValueGeneratedOnAdd()
341  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
342 
343  b.Property<string>("AccessToken");
344 
345  b.Property<string>("AccessUser");
346 
347  b.Property<bool?>("AutoUpdatesKeepTestMerges")
348  .IsRequired();
349 
350  b.Property<bool?>("AutoUpdatesSynchronize")
351  .IsRequired();
352 
353  b.Property<string>("CommitterEmail")
354  .IsRequired();
355 
356  b.Property<string>("CommitterName")
357  .IsRequired();
358 
359  b.Property<long>("InstanceId");
360 
361  b.Property<bool?>("PushTestMergeCommits")
362  .IsRequired();
363 
364  b.Property<bool?>("ShowTestMergeCommitters")
365  .IsRequired();
366 
367  b.HasKey("Id");
368 
369  b.HasIndex("InstanceId")
370  .IsUnique();
371 
372  b.ToTable("RepositorySettings");
373  });
374 
375  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
376  {
377  b.Property<long>("Id")
378  .ValueGeneratedOnAdd()
379  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
380 
381  b.Property<long>("RevisionInformationId");
382 
383  b.Property<long>("TestMergeId");
384 
385  b.HasKey("Id");
386 
387  b.HasIndex("RevisionInformationId");
388 
389  b.HasIndex("TestMergeId");
390 
391  b.ToTable("RevInfoTestMerges");
392  });
393 
394  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
395  {
396  b.Property<long>("Id")
397  .ValueGeneratedOnAdd()
398  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
399 
400  b.Property<string>("CommitSha")
401  .IsRequired()
402  .HasMaxLength(40);
403 
404  b.Property<long>("InstanceId");
405 
406  b.Property<string>("OriginCommitSha")
407  .IsRequired()
408  .HasMaxLength(40);
409 
410  b.HasKey("Id");
411 
412  b.HasIndex("CommitSha")
413  .IsUnique();
414 
415  b.HasIndex("InstanceId");
416 
417  b.ToTable("RevisionInformations");
418  });
419 
420  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
421  {
422  b.Property<long>("Id")
423  .ValueGeneratedOnAdd()
424  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
425 
426  b.Property<string>("Author")
427  .IsRequired();
428 
429  b.Property<string>("BodyAtMerge")
430  .IsRequired();
431 
432  b.Property<string>("Comment");
433 
434  b.Property<DateTimeOffset>("MergedAt");
435 
436  b.Property<long>("MergedById");
437 
438  b.Property<int?>("Number")
439  .IsRequired();
440 
441  b.Property<long?>("PrimaryRevisionInformationId");
442 
443  b.Property<string>("PullRequestRevision")
444  .IsRequired();
445 
446  b.Property<string>("TitleAtMerge")
447  .IsRequired();
448 
449  b.Property<string>("Url")
450  .IsRequired();
451 
452  b.HasKey("Id");
453 
454  b.HasIndex("MergedById");
455 
456  b.HasIndex("PrimaryRevisionInformationId")
457  .IsUnique()
458  .HasFilter("[PrimaryRevisionInformationId] IS NOT NULL");
459 
460  b.ToTable("TestMerges");
461  });
462 
463  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
464  {
465  b.Property<long>("Id")
466  .ValueGeneratedOnAdd()
467  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
468 
469  b.Property<decimal>("AdministrationRights")
470  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
471 
472  b.Property<string>("CanonicalName")
473  .IsRequired();
474 
475  b.Property<DateTimeOffset?>("CreatedAt")
476  .IsRequired();
477 
478  b.Property<long?>("CreatedById");
479 
480  b.Property<bool?>("Enabled")
481  .IsRequired();
482 
483  b.Property<decimal>("InstanceManagerRights")
484  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
485 
486  b.Property<DateTimeOffset?>("LastPasswordUpdate");
487 
488  b.Property<string>("Name")
489  .IsRequired();
490 
491  b.Property<string>("PasswordHash");
492 
493  b.Property<string>("SystemIdentifier");
494 
495  b.HasKey("Id");
496 
497  b.HasIndex("CanonicalName")
498  .IsUnique();
499 
500  b.HasIndex("CreatedById");
501 
502  b.ToTable("Users");
503  });
504 
505  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
506  {
507  b.Property<long>("Id")
508  .ValueGeneratedOnAdd()
509  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
510 
511  b.Property<long?>("AlphaId");
512 
513  b.Property<bool>("AlphaIsActive");
514 
515  b.Property<long?>("BravoId");
516 
517  b.HasKey("Id");
518 
519  b.HasIndex("AlphaId");
520 
521  b.HasIndex("BravoId");
522 
523  b.ToTable("WatchdogReattachInformations");
524  });
525 
526  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
527  {
528  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
529  .WithMany("ChatSettings")
530  .HasForeignKey("InstanceId")
531  .OnDelete(DeleteBehavior.Cascade);
532  });
533 
534  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
535  {
536  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
537  .WithMany("Channels")
538  .HasForeignKey("ChatSettingsId")
539  .OnDelete(DeleteBehavior.Cascade);
540  });
541 
542  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
543  {
544  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
545  .WithMany()
546  .HasForeignKey("JobId");
547 
548  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
549  .WithMany("CompileJobs")
550  .HasForeignKey("RevisionInformationId")
551  .OnDelete(DeleteBehavior.Cascade);
552  });
553 
554  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
555  {
556  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
557  .WithOne("DreamDaemonSettings")
558  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
559  .OnDelete(DeleteBehavior.Cascade);
560  });
561 
562  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
563  {
564  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
565  .WithOne("DreamMakerSettings")
566  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
567  .OnDelete(DeleteBehavior.Cascade);
568  });
569 
570  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
571  {
572  b.HasOne("Tgstation.Server.Host.Models.WatchdogReattachInformation", "WatchdogReattachInformation")
573  .WithMany()
574  .HasForeignKey("WatchdogReattachInformationId");
575  });
576 
577  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
578  {
579  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
580  .WithMany("InstanceUsers")
581  .HasForeignKey("InstanceId")
582  .OnDelete(DeleteBehavior.Cascade);
583 
584  b.HasOne("Tgstation.Server.Host.Models.User")
585  .WithMany("InstanceUsers")
586  .HasForeignKey("UserId")
587  .OnDelete(DeleteBehavior.Cascade);
588  });
589 
590  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
591  {
592  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
593  .WithMany()
594  .HasForeignKey("CancelledById");
595 
596  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
597  .WithMany("Jobs")
598  .HasForeignKey("InstanceId")
599  .OnDelete(DeleteBehavior.Cascade);
600 
601  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
602  .WithMany()
603  .HasForeignKey("StartedById")
604  .OnDelete(DeleteBehavior.Cascade);
605  });
606 
607  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
608  {
609  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
610  .WithMany()
611  .HasForeignKey("CompileJobId");
612  });
613 
614  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
615  {
616  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
617  .WithOne("RepositorySettings")
618  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
619  .OnDelete(DeleteBehavior.Cascade);
620  });
621 
622  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
623  {
624  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
625  .WithMany("ActiveTestMerges")
626  .HasForeignKey("RevisionInformationId")
627  .OnDelete(DeleteBehavior.Cascade);
628 
629  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
630  .WithMany("RevisonInformations")
631  .HasForeignKey("TestMergeId")
632  .OnDelete(DeleteBehavior.Cascade);
633  });
634 
635  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
636  {
637  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
638  .WithMany("RevisionInformations")
639  .HasForeignKey("InstanceId")
640  .OnDelete(DeleteBehavior.Cascade);
641  });
642 
643  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
644  {
645  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
646  .WithMany("TestMerges")
647  .HasForeignKey("MergedById")
648  .OnDelete(DeleteBehavior.Restrict);
649 
650  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
651  .WithOne("PrimaryTestMerge")
652  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
653  .OnDelete(DeleteBehavior.SetNull);
654  });
655 
656  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
657  {
658  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
659  .WithMany("CreatedUsers")
660  .HasForeignKey("CreatedById");
661  });
662 
663  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
664  {
665  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
666  .WithMany()
667  .HasForeignKey("AlphaId");
668 
669  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
670  .WithMany()
671  .HasForeignKey("BravoId");
672  });
673 #pragma warning restore 612, 618
674  }
675  }
676 }
+Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
8 
10 {
11  [DbContext(typeof(SqlServerDatabaseContext))]
12  [Migration("20180918021228_MSAddMinimumSecurity")]
13  partial class MSAddMinimumSecurity
14  {
19  protected override void BuildTargetModel(ModelBuilder modelBuilder)
20  {
21 #pragma warning disable 612, 618
22  modelBuilder
23  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
24  .HasAnnotation("Relational:MaxIdentifierLength", 128)
25  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
26 
27  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
28  {
29  b.Property<long>("Id")
30  .ValueGeneratedOnAdd()
31  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
32 
33  b.Property<string>("ConnectionString")
34  .IsRequired();
35 
36  b.Property<bool?>("Enabled");
37 
38  b.Property<long>("InstanceId");
39 
40  b.Property<string>("Name")
41  .IsRequired();
42 
43  b.Property<int?>("Provider");
44 
45  b.HasKey("Id");
46 
47  b.HasIndex("InstanceId");
48 
49  b.HasIndex("Name")
50  .IsUnique();
51 
52  b.ToTable("ChatBots");
53  });
54 
55  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
56  {
57  b.Property<long>("Id")
58  .ValueGeneratedOnAdd()
59  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
60 
61  b.Property<long>("ChatSettingsId");
62 
63  b.Property<decimal?>("DiscordChannelId")
64  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
65 
66  b.Property<string>("IrcChannel");
67 
68  b.Property<bool?>("IsAdminChannel")
69  .IsRequired();
70 
71  b.Property<bool?>("IsUpdatesChannel")
72  .IsRequired();
73 
74  b.Property<bool?>("IsWatchdogChannel")
75  .IsRequired();
76 
77  b.Property<string>("Tag");
78 
79  b.HasKey("Id");
80 
81  b.HasIndex("ChatSettingsId", "DiscordChannelId")
82  .IsUnique()
83  .HasFilter("[DiscordChannelId] IS NOT NULL");
84 
85  b.HasIndex("ChatSettingsId", "IrcChannel")
86  .IsUnique()
87  .HasFilter("[IrcChannel] IS NOT NULL");
88 
89  b.ToTable("ChatChannels");
90  });
91 
92  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
93  {
94  b.Property<long>("Id")
95  .ValueGeneratedOnAdd()
96  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
97 
98  b.Property<string>("ByondVersion")
99  .IsRequired();
100 
101  b.Property<Guid?>("DirectoryName");
102 
103  b.Property<string>("DmeName");
104 
105  b.Property<long?>("JobId");
106 
107  b.Property<int>("MinimumSecurityLevel");
108 
109  b.Property<string>("Output");
110 
111  b.Property<long>("RevisionInformationId");
112 
113  b.HasKey("Id");
114 
115  b.HasIndex("DirectoryName");
116 
117  b.HasIndex("JobId");
118 
119  b.HasIndex("RevisionInformationId");
120 
121  b.ToTable("CompileJobs");
122  });
123 
124  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
125  {
126  b.Property<long>("Id")
127  .ValueGeneratedOnAdd()
128  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
129 
130  b.Property<string>("AccessToken");
131 
132  b.Property<bool?>("AllowWebClient")
133  .IsRequired();
134 
135  b.Property<bool?>("AutoStart")
136  .IsRequired();
137 
138  b.Property<long>("InstanceId");
139 
140  b.Property<int>("PrimaryPort");
141 
142  b.Property<int?>("ProcessId");
143 
144  b.Property<int>("SecondaryPort");
145 
146  b.Property<int>("SecurityLevel");
147 
148  b.Property<bool?>("SoftRestart")
149  .IsRequired();
150 
151  b.Property<bool?>("SoftShutdown")
152  .IsRequired();
153 
154  b.Property<long>("StartupTimeout");
155 
156  b.HasKey("Id");
157 
158  b.HasIndex("InstanceId")
159  .IsUnique();
160 
161  b.ToTable("DreamDaemonSettings");
162  });
163 
164  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
165  {
166  b.Property<long>("Id")
167  .ValueGeneratedOnAdd()
168  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
169 
170  b.Property<int>("ApiValidationPort");
171 
172  b.Property<int>("ApiValidationSecurityLevel");
173 
174  b.Property<long>("InstanceId");
175 
176  b.Property<string>("ProjectName");
177 
178  b.HasKey("Id");
179 
180  b.HasIndex("InstanceId")
181  .IsUnique();
182 
183  b.ToTable("DreamMakerSettings");
184  });
185 
186  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
187  {
188  b.Property<long>("Id")
189  .ValueGeneratedOnAdd()
190  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
191 
192  b.Property<long>("AutoUpdateInterval");
193 
194  b.Property<int>("ConfigurationType");
195 
196  b.Property<string>("Name")
197  .IsRequired();
198 
199  b.Property<bool?>("Online")
200  .IsRequired();
201 
202  b.Property<string>("Path")
203  .IsRequired();
204 
205  b.Property<long?>("WatchdogReattachInformationId");
206 
207  b.HasKey("Id");
208 
209  b.HasIndex("Path")
210  .IsUnique();
211 
212  b.HasIndex("WatchdogReattachInformationId");
213 
214  b.ToTable("Instances");
215  });
216 
217  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
218  {
219  b.Property<long>("Id")
220  .ValueGeneratedOnAdd()
221  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
222 
223  b.Property<decimal>("ByondRights")
224  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
225 
226  b.Property<decimal>("ChatBotRights")
227  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
228 
229  b.Property<decimal>("ConfigurationRights")
230  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
231 
232  b.Property<decimal>("DreamDaemonRights")
233  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
234 
235  b.Property<decimal>("DreamMakerRights")
236  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
237 
238  b.Property<long>("InstanceId");
239 
240  b.Property<decimal>("InstanceUserRights")
241  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
242 
243  b.Property<decimal>("RepositoryRights")
244  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
245 
246  b.Property<long?>("UserId")
247  .IsRequired();
248 
249  b.HasKey("Id");
250 
251  b.HasIndex("InstanceId");
252 
253  b.HasIndex("UserId", "InstanceId")
254  .IsUnique();
255 
256  b.ToTable("InstanceUsers");
257  });
258 
259  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
260  {
261  b.Property<long>("Id")
262  .ValueGeneratedOnAdd()
263  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
264 
265  b.Property<decimal?>("CancelRight")
266  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
267 
268  b.Property<decimal?>("CancelRightsType")
269  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
270 
271  b.Property<bool?>("Cancelled")
272  .IsRequired();
273 
274  b.Property<long?>("CancelledById");
275 
276  b.Property<string>("Description")
277  .IsRequired();
278 
279  b.Property<string>("ExceptionDetails");
280 
281  b.Property<long>("InstanceId");
282 
283  b.Property<DateTimeOffset?>("StartedAt")
284  .IsRequired();
285 
286  b.Property<long>("StartedById");
287 
288  b.Property<DateTimeOffset?>("StoppedAt");
289 
290  b.HasKey("Id");
291 
292  b.HasIndex("CancelledById");
293 
294  b.HasIndex("InstanceId");
295 
296  b.HasIndex("StartedById");
297 
298  b.ToTable("Jobs");
299  });
300 
301  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
302  {
303  b.Property<long>("Id")
304  .ValueGeneratedOnAdd()
305  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
306 
307  b.Property<string>("AccessIdentifier")
308  .IsRequired();
309 
310  b.Property<string>("ChatChannelsJson")
311  .IsRequired();
312 
313  b.Property<string>("ChatCommandsJson")
314  .IsRequired();
315 
316  b.Property<long?>("CompileJobId");
317 
318  b.Property<bool>("IsPrimary");
319 
320  b.Property<int>("Port");
321 
322  b.Property<int>("ProcessId");
323 
324  b.Property<int>("RebootState");
325 
326  b.Property<string>("ServerCommandsJson")
327  .IsRequired();
328 
329  b.HasKey("Id");
330 
331  b.HasIndex("CompileJobId");
332 
333  b.ToTable("ReattachInformations");
334  });
335 
336  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
337  {
338  b.Property<long>("Id")
339  .ValueGeneratedOnAdd()
340  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
341 
342  b.Property<string>("AccessToken");
343 
344  b.Property<string>("AccessUser");
345 
346  b.Property<bool?>("AutoUpdatesKeepTestMerges")
347  .IsRequired();
348 
349  b.Property<bool?>("AutoUpdatesSynchronize")
350  .IsRequired();
351 
352  b.Property<string>("CommitterEmail")
353  .IsRequired();
354 
355  b.Property<string>("CommitterName")
356  .IsRequired();
357 
358  b.Property<long>("InstanceId");
359 
360  b.Property<bool?>("PushTestMergeCommits")
361  .IsRequired();
362 
363  b.Property<bool?>("ShowTestMergeCommitters")
364  .IsRequired();
365 
366  b.HasKey("Id");
367 
368  b.HasIndex("InstanceId")
369  .IsUnique();
370 
371  b.ToTable("RepositorySettings");
372  });
373 
374  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
375  {
376  b.Property<long>("Id")
377  .ValueGeneratedOnAdd()
378  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
379 
380  b.Property<long>("RevisionInformationId");
381 
382  b.Property<long>("TestMergeId");
383 
384  b.HasKey("Id");
385 
386  b.HasIndex("RevisionInformationId");
387 
388  b.HasIndex("TestMergeId");
389 
390  b.ToTable("RevInfoTestMerges");
391  });
392 
393  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
394  {
395  b.Property<long>("Id")
396  .ValueGeneratedOnAdd()
397  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
398 
399  b.Property<string>("CommitSha")
400  .IsRequired()
401  .HasMaxLength(40);
402 
403  b.Property<long>("InstanceId");
404 
405  b.Property<string>("OriginCommitSha")
406  .IsRequired()
407  .HasMaxLength(40);
408 
409  b.HasKey("Id");
410 
411  b.HasIndex("CommitSha")
412  .IsUnique();
413 
414  b.HasIndex("InstanceId");
415 
416  b.ToTable("RevisionInformations");
417  });
418 
419  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
420  {
421  b.Property<long>("Id")
422  .ValueGeneratedOnAdd()
423  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
424 
425  b.Property<string>("Author")
426  .IsRequired();
427 
428  b.Property<string>("BodyAtMerge")
429  .IsRequired();
430 
431  b.Property<string>("Comment");
432 
433  b.Property<DateTimeOffset>("MergedAt");
434 
435  b.Property<long>("MergedById");
436 
437  b.Property<int?>("Number")
438  .IsRequired();
439 
440  b.Property<long?>("PrimaryRevisionInformationId");
441 
442  b.Property<string>("PullRequestRevision")
443  .IsRequired();
444 
445  b.Property<string>("TitleAtMerge")
446  .IsRequired();
447 
448  b.Property<string>("Url")
449  .IsRequired();
450 
451  b.HasKey("Id");
452 
453  b.HasIndex("MergedById");
454 
455  b.HasIndex("PrimaryRevisionInformationId")
456  .IsUnique()
457  .HasFilter("[PrimaryRevisionInformationId] IS NOT NULL");
458 
459  b.ToTable("TestMerges");
460  });
461 
462  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
463  {
464  b.Property<long>("Id")
465  .ValueGeneratedOnAdd()
466  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
467 
468  b.Property<decimal>("AdministrationRights")
469  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
470 
471  b.Property<string>("CanonicalName")
472  .IsRequired();
473 
474  b.Property<DateTimeOffset?>("CreatedAt")
475  .IsRequired();
476 
477  b.Property<long?>("CreatedById");
478 
479  b.Property<bool?>("Enabled")
480  .IsRequired();
481 
482  b.Property<decimal>("InstanceManagerRights")
483  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
484 
485  b.Property<DateTimeOffset?>("LastPasswordUpdate");
486 
487  b.Property<string>("Name")
488  .IsRequired();
489 
490  b.Property<string>("PasswordHash");
491 
492  b.Property<string>("SystemIdentifier");
493 
494  b.HasKey("Id");
495 
496  b.HasIndex("CanonicalName")
497  .IsUnique();
498 
499  b.HasIndex("CreatedById");
500 
501  b.ToTable("Users");
502  });
503 
504  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
505  {
506  b.Property<long>("Id")
507  .ValueGeneratedOnAdd()
508  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
509 
510  b.Property<long?>("AlphaId");
511 
512  b.Property<bool>("AlphaIsActive");
513 
514  b.Property<long?>("BravoId");
515 
516  b.HasKey("Id");
517 
518  b.HasIndex("AlphaId");
519 
520  b.HasIndex("BravoId");
521 
522  b.ToTable("WatchdogReattachInformations");
523  });
524 
525  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
526  {
527  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
528  .WithMany("ChatSettings")
529  .HasForeignKey("InstanceId")
530  .OnDelete(DeleteBehavior.Cascade);
531  });
532 
533  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
534  {
535  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
536  .WithMany("Channels")
537  .HasForeignKey("ChatSettingsId")
538  .OnDelete(DeleteBehavior.Cascade);
539  });
540 
541  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
542  {
543  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
544  .WithMany()
545  .HasForeignKey("JobId");
546 
547  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
548  .WithMany("CompileJobs")
549  .HasForeignKey("RevisionInformationId")
550  .OnDelete(DeleteBehavior.Cascade);
551  });
552 
553  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
554  {
555  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
556  .WithOne("DreamDaemonSettings")
557  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
558  .OnDelete(DeleteBehavior.Cascade);
559  });
560 
561  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
562  {
563  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
564  .WithOne("DreamMakerSettings")
565  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
566  .OnDelete(DeleteBehavior.Cascade);
567  });
568 
569  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
570  {
571  b.HasOne("Tgstation.Server.Host.Models.WatchdogReattachInformation", "WatchdogReattachInformation")
572  .WithMany()
573  .HasForeignKey("WatchdogReattachInformationId");
574  });
575 
576  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
577  {
578  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
579  .WithMany("InstanceUsers")
580  .HasForeignKey("InstanceId")
581  .OnDelete(DeleteBehavior.Cascade);
582 
583  b.HasOne("Tgstation.Server.Host.Models.User")
584  .WithMany("InstanceUsers")
585  .HasForeignKey("UserId")
586  .OnDelete(DeleteBehavior.Cascade);
587  });
588 
589  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
590  {
591  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
592  .WithMany()
593  .HasForeignKey("CancelledById");
594 
595  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
596  .WithMany("Jobs")
597  .HasForeignKey("InstanceId")
598  .OnDelete(DeleteBehavior.Cascade);
599 
600  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
601  .WithMany()
602  .HasForeignKey("StartedById")
603  .OnDelete(DeleteBehavior.Cascade);
604  });
605 
606  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
607  {
608  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
609  .WithMany()
610  .HasForeignKey("CompileJobId");
611  });
612 
613  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
614  {
615  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
616  .WithOne("RepositorySettings")
617  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
618  .OnDelete(DeleteBehavior.Cascade);
619  });
620 
621  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
622  {
623  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
624  .WithMany("ActiveTestMerges")
625  .HasForeignKey("RevisionInformationId")
626  .OnDelete(DeleteBehavior.Cascade);
627 
628  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
629  .WithMany("RevisonInformations")
630  .HasForeignKey("TestMergeId")
631  .OnDelete(DeleteBehavior.Cascade);
632  });
633 
634  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
635  {
636  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
637  .WithMany("RevisionInformations")
638  .HasForeignKey("InstanceId")
639  .OnDelete(DeleteBehavior.Cascade);
640  });
641 
642  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
643  {
644  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
645  .WithMany("TestMerges")
646  .HasForeignKey("MergedById")
647  .OnDelete(DeleteBehavior.Restrict);
648 
649  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
650  .WithOne("PrimaryTestMerge")
651  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
652  .OnDelete(DeleteBehavior.SetNull);
653  });
654 
655  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
656  {
657  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
658  .WithMany("CreatedUsers")
659  .HasForeignKey("CreatedById");
660  });
661 
662  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
663  {
664  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
665  .WithMany()
666  .HasForeignKey("AlphaId");
667 
668  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
669  .WithMany()
670  .HasForeignKey("BravoId");
671  });
672 #pragma warning restore 612, 618
673  }
674  }
675 }
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
-
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
- -
DatabaseContext<TParentContext> for Sqlserver
- - - +
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MSAddMinimumSecurity
 Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel columns for MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MSAddMinimumSecurity
 Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel columns for MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180918021228___m_s_add_minimum_security_8cs_source.html b/20180918021228___m_s_add_minimum_security_8cs_source.html index 8459b85cf5..c86ab9d872 100644 --- a/20180918021228___m_s_add_minimum_security_8cs_source.html +++ b/20180918021228___m_s_add_minimum_security_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180918021228_MSAddMinimumSecurity.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180918021228_MSAddMinimumSecurity.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,14 +71,14 @@ $(function() {
20180918021228_MSAddMinimumSecurity.cs
-Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
4 
6 {
10  public partial class MSAddMinimumSecurity : Migration
11  {
16  protected override void Up(MigrationBuilder migrationBuilder)
17  {
18  if (migrationBuilder == null)
19  throw new ArgumentNullException(nameof(migrationBuilder));
20 
21  migrationBuilder.AddColumn<int>(
22  name: "ApiValidationSecurityLevel",
23  table: "DreamMakerSettings",
24  nullable: false,
25  defaultValue: (int)DreamDaemonSecurity.Safe);
26 
27  migrationBuilder.AddColumn<int>(
28  name: "MinimumSecurityLevel",
29  table: "CompileJobs",
30  nullable: false,
31  defaultValue: (int)DreamDaemonSecurity.Safe);
32  }
33 
38  protected override void Down(MigrationBuilder migrationBuilder)
39  {
40  if (migrationBuilder == null)
41  throw new ArgumentNullException(nameof(migrationBuilder));
42 
43  migrationBuilder.DropColumn(
44  name: "ApiValidationSecurityLevel",
45  table: "DreamMakerSettings");
46 
47  migrationBuilder.DropColumn(
48  name: "MinimumSecurityLevel",
49  table: "CompileJobs");
50  }
51  }
52 }
-
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
- +Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
4 
6 {
10  public partial class MSAddMinimumSecurity : Migration
11  {
16  protected override void Up(MigrationBuilder migrationBuilder)
17  {
18  if (migrationBuilder == null)
19  throw new ArgumentNullException(nameof(migrationBuilder));
20 
21  migrationBuilder.AddColumn<int>(
22  name: "ApiValidationSecurityLevel",
23  table: "DreamMakerSettings",
24  nullable: false,
25  defaultValue: (int)DreamDaemonSecurity.Safe);
26 
27  migrationBuilder.AddColumn<int>(
28  name: "MinimumSecurityLevel",
29  table: "CompileJobs",
30  nullable: false,
31  defaultValue: (int)DreamDaemonSecurity.Safe);
32  }
33 
38  protected override void Down(MigrationBuilder migrationBuilder)
39  {
40  if (migrationBuilder == null)
41  throw new ArgumentNullException(nameof(migrationBuilder));
42 
43  migrationBuilder.DropColumn(
44  name: "ApiValidationSecurityLevel",
45  table: "DreamMakerSettings");
46 
47  migrationBuilder.DropColumn(
48  name: "MinimumSecurityLevel",
49  table: "CompileJobs");
50  }
51  }
52 }
+
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
+
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
-
Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel...
+
Add the Api.Models.Internal.CompileJob.MinimumSecurityLevel and DreamMaker.ApiValidationSecurityLevel...
+ -
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
DreamDaemonSecurity
DreamDaemon's security level
diff --git a/20180918204520___m_y_nullable_and_foreign_key_cleanup_8_designer_8cs.html b/20180918204520___m_y_nullable_and_foreign_key_cleanup_8_designer_8cs.html index f8d140926b..e9e914084b 100644 --- a/20180918204520___m_y_nullable_and_foreign_key_cleanup_8_designer_8cs.html +++ b/20180918204520___m_y_nullable_and_foreign_key_cleanup_8_designer_8cs.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180918204520_MYNullableAndForeignKeyCleanup.Designer.cs File Reference +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180918204520_MYNullableAndForeignKeyCleanup.Designer.cs File Reference @@ -63,7 +63,7 @@ $(function() {
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MYNullableAndForeignKeyCleanup
 Cleans up of nullable columns and foreign keys MySQL/MariaDB More...
class  Tgstation.Server.Host.Database.Migrations.MYNullableAndForeignKeyCleanup
 Cleans up of nullable columns and foreign keys MySQL/MariaDB More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180918204520___m_y_nullable_and_foreign_key_cleanup_8_designer_8cs_source.html b/20180918204520___m_y_nullable_and_foreign_key_cleanup_8_designer_8cs_source.html index 4556439e18..4a1eee3e23 100644 --- a/20180918204520___m_y_nullable_and_foreign_key_cleanup_8_designer_8cs_source.html +++ b/20180918204520___m_y_nullable_and_foreign_key_cleanup_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180918204520_MYNullableAndForeignKeyCleanup.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180918204520_MYNullableAndForeignKeyCleanup.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20180918204520_MYNullableAndForeignKeyCleanup.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
7 
9 {
11  [Migration("20180918204520_MYNullableAndForeignKeyCleanup")]
12  partial class MYNullableAndForeignKeyCleanup
13  {
18  protected override void BuildTargetModel(ModelBuilder modelBuilder)
19  {
20 #pragma warning disable 612, 618
21  modelBuilder
22  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
23  .HasAnnotation("Relational:MaxIdentifierLength", 64);
24 
25  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
26  {
27  b.Property<long>("Id")
28  .ValueGeneratedOnAdd();
29 
30  b.Property<string>("ConnectionString")
31  .IsRequired();
32 
33  b.Property<bool?>("Enabled");
34 
35  b.Property<long>("InstanceId");
36 
37  b.Property<string>("Name")
38  .IsRequired();
39 
40  b.Property<int?>("Provider");
41 
42  b.HasKey("Id");
43 
44  b.HasIndex("InstanceId");
45 
46  b.HasIndex("Name")
47  .IsUnique();
48 
49  b.ToTable("ChatBots");
50  });
51 
52  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
53  {
54  b.Property<long>("Id")
55  .ValueGeneratedOnAdd();
56 
57  b.Property<long>("ChatSettingsId");
58 
59  b.Property<ulong?>("DiscordChannelId");
60 
61  b.Property<string>("IrcChannel");
62 
63  b.Property<bool?>("IsAdminChannel")
64  .IsRequired();
65 
66  b.Property<bool?>("IsUpdatesChannel")
67  .IsRequired();
68 
69  b.Property<bool?>("IsWatchdogChannel")
70  .IsRequired();
71 
72  b.Property<string>("Tag");
73 
74  b.HasKey("Id");
75 
76  b.HasIndex("ChatSettingsId", "DiscordChannelId")
77  .IsUnique();
78 
79  b.HasIndex("ChatSettingsId", "IrcChannel")
80  .IsUnique();
81 
82  b.ToTable("ChatChannels");
83  });
84 
85  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
86  {
87  b.Property<long>("Id")
88  .ValueGeneratedOnAdd();
89 
90  b.Property<string>("ByondVersion")
91  .IsRequired();
92 
93  b.Property<Guid?>("DirectoryName")
94  .IsRequired();
95 
96  b.Property<string>("DmeName")
97  .IsRequired();
98 
99  b.Property<long>("JobId");
100 
101  b.Property<int>("MinimumSecurityLevel");
102 
103  b.Property<string>("Output")
104  .IsRequired();
105 
106  b.Property<long>("RevisionInformationId");
107 
108  b.HasKey("Id");
109 
110  b.HasIndex("DirectoryName");
111 
112  b.HasIndex("JobId")
113  .IsUnique();
114 
115  b.HasIndex("RevisionInformationId");
116 
117  b.ToTable("CompileJobs");
118  });
119 
120  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
121  {
122  b.Property<long>("Id")
123  .ValueGeneratedOnAdd();
124 
125  b.Property<string>("AccessToken");
126 
127  b.Property<bool?>("AllowWebClient")
128  .IsRequired();
129 
130  b.Property<bool?>("AutoStart")
131  .IsRequired();
132 
133  b.Property<long>("InstanceId");
134 
135  b.Property<ushort?>("PrimaryPort")
136  .IsRequired();
137 
138  b.Property<int?>("ProcessId");
139 
140  b.Property<ushort?>("SecondaryPort")
141  .IsRequired();
142 
143  b.Property<int>("SecurityLevel");
144 
145  b.Property<bool?>("SoftRestart")
146  .IsRequired();
147 
148  b.Property<bool?>("SoftShutdown")
149  .IsRequired();
150 
151  b.Property<uint?>("StartupTimeout")
152  .IsRequired();
153 
154  b.HasKey("Id");
155 
156  b.HasIndex("InstanceId")
157  .IsUnique();
158 
159  b.ToTable("DreamDaemonSettings");
160  });
161 
162  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
163  {
164  b.Property<long>("Id")
165  .ValueGeneratedOnAdd();
166 
167  b.Property<ushort?>("ApiValidationPort")
168  .IsRequired();
169 
170  b.Property<int>("ApiValidationSecurityLevel");
171 
172  b.Property<long>("InstanceId");
173 
174  b.Property<string>("ProjectName");
175 
176  b.HasKey("Id");
177 
178  b.HasIndex("InstanceId")
179  .IsUnique();
180 
181  b.ToTable("DreamMakerSettings");
182  });
183 
184  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
185  {
186  b.Property<long>("Id")
187  .ValueGeneratedOnAdd();
188 
189  b.Property<uint?>("AutoUpdateInterval")
190  .IsRequired();
191 
192  b.Property<int>("ConfigurationType");
193 
194  b.Property<string>("Name")
195  .IsRequired();
196 
197  b.Property<bool?>("Online")
198  .IsRequired();
199 
200  b.Property<string>("Path")
201  .IsRequired();
202 
203  b.HasKey("Id");
204 
205  b.HasIndex("Path")
206  .IsUnique();
207 
208  b.ToTable("Instances");
209  });
210 
211  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
212  {
213  b.Property<long>("Id")
214  .ValueGeneratedOnAdd();
215 
216  b.Property<ulong>("ByondRights");
217 
218  b.Property<ulong>("ChatBotRights");
219 
220  b.Property<ulong>("ConfigurationRights");
221 
222  b.Property<ulong>("DreamDaemonRights");
223 
224  b.Property<ulong>("DreamMakerRights");
225 
226  b.Property<long>("InstanceId");
227 
228  b.Property<ulong>("InstanceUserRights");
229 
230  b.Property<ulong>("RepositoryRights");
231 
232  b.Property<long?>("UserId")
233  .IsRequired();
234 
235  b.HasKey("Id");
236 
237  b.HasIndex("InstanceId");
238 
239  b.HasIndex("UserId", "InstanceId")
240  .IsUnique();
241 
242  b.ToTable("InstanceUsers");
243  });
244 
245  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
246  {
247  b.Property<long>("Id")
248  .ValueGeneratedOnAdd();
249 
250  b.Property<ulong?>("CancelRight");
251 
252  b.Property<ulong?>("CancelRightsType");
253 
254  b.Property<bool?>("Cancelled")
255  .IsRequired();
256 
257  b.Property<long?>("CancelledById");
258 
259  b.Property<string>("Description")
260  .IsRequired();
261 
262  b.Property<string>("ExceptionDetails");
263 
264  b.Property<long>("InstanceId");
265 
266  b.Property<DateTimeOffset?>("StartedAt")
267  .IsRequired();
268 
269  b.Property<long>("StartedById");
270 
271  b.Property<DateTimeOffset?>("StoppedAt");
272 
273  b.HasKey("Id");
274 
275  b.HasIndex("CancelledById");
276 
277  b.HasIndex("InstanceId");
278 
279  b.HasIndex("StartedById");
280 
281  b.ToTable("Jobs");
282  });
283 
284  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
285  {
286  b.Property<long>("Id")
287  .ValueGeneratedOnAdd();
288 
289  b.Property<string>("AccessIdentifier")
290  .IsRequired();
291 
292  b.Property<string>("ChatChannelsJson")
293  .IsRequired();
294 
295  b.Property<string>("ChatCommandsJson")
296  .IsRequired();
297 
298  b.Property<long?>("CompileJobId");
299 
300  b.Property<bool>("IsPrimary");
301 
302  b.Property<ushort>("Port");
303 
304  b.Property<int>("ProcessId");
305 
306  b.Property<int>("RebootState");
307 
308  b.Property<string>("ServerCommandsJson")
309  .IsRequired();
310 
311  b.HasKey("Id");
312 
313  b.HasIndex("CompileJobId");
314 
315  b.ToTable("ReattachInformations");
316  });
317 
318  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
319  {
320  b.Property<long>("Id")
321  .ValueGeneratedOnAdd();
322 
323  b.Property<string>("AccessToken");
324 
325  b.Property<string>("AccessUser");
326 
327  b.Property<bool?>("AutoUpdatesKeepTestMerges")
328  .IsRequired();
329 
330  b.Property<bool?>("AutoUpdatesSynchronize")
331  .IsRequired();
332 
333  b.Property<string>("CommitterEmail")
334  .IsRequired();
335 
336  b.Property<string>("CommitterName")
337  .IsRequired();
338 
339  b.Property<long>("InstanceId");
340 
341  b.Property<bool?>("PushTestMergeCommits")
342  .IsRequired();
343 
344  b.Property<bool?>("ShowTestMergeCommitters")
345  .IsRequired();
346 
347  b.HasKey("Id");
348 
349  b.HasIndex("InstanceId")
350  .IsUnique();
351 
352  b.ToTable("RepositorySettings");
353  });
354 
355  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
356  {
357  b.Property<long>("Id")
358  .ValueGeneratedOnAdd();
359 
360  b.Property<long>("RevisionInformationId");
361 
362  b.Property<long>("TestMergeId");
363 
364  b.HasKey("Id");
365 
366  b.HasIndex("RevisionInformationId");
367 
368  b.HasIndex("TestMergeId");
369 
370  b.ToTable("RevInfoTestMerges");
371  });
372 
373  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
374  {
375  b.Property<long>("Id")
376  .ValueGeneratedOnAdd();
377 
378  b.Property<string>("CommitSha")
379  .IsRequired()
380  .HasMaxLength(40);
381 
382  b.Property<long>("InstanceId");
383 
384  b.Property<string>("OriginCommitSha")
385  .IsRequired()
386  .HasMaxLength(40);
387 
388  b.HasKey("Id");
389 
390  b.HasIndex("CommitSha")
391  .IsUnique();
392 
393  b.HasIndex("InstanceId");
394 
395  b.ToTable("RevisionInformations");
396  });
397 
398  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
399  {
400  b.Property<long>("Id")
401  .ValueGeneratedOnAdd();
402 
403  b.Property<string>("Author")
404  .IsRequired();
405 
406  b.Property<string>("BodyAtMerge")
407  .IsRequired();
408 
409  b.Property<string>("Comment");
410 
411  b.Property<DateTimeOffset>("MergedAt");
412 
413  b.Property<long>("MergedById");
414 
415  b.Property<int?>("Number")
416  .IsRequired();
417 
418  b.Property<long?>("PrimaryRevisionInformationId")
419  .IsRequired();
420 
421  b.Property<string>("PullRequestRevision")
422  .IsRequired();
423 
424  b.Property<string>("TitleAtMerge")
425  .IsRequired();
426 
427  b.Property<string>("Url")
428  .IsRequired();
429 
430  b.HasKey("Id");
431 
432  b.HasIndex("MergedById");
433 
434  b.HasIndex("PrimaryRevisionInformationId")
435  .IsUnique();
436 
437  b.ToTable("TestMerges");
438  });
439 
440  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
441  {
442  b.Property<long>("Id")
443  .ValueGeneratedOnAdd();
444 
445  b.Property<ulong>("AdministrationRights");
446 
447  b.Property<string>("CanonicalName")
448  .IsRequired();
449 
450  b.Property<DateTimeOffset?>("CreatedAt")
451  .IsRequired();
452 
453  b.Property<long?>("CreatedById");
454 
455  b.Property<bool?>("Enabled")
456  .IsRequired();
457 
458  b.Property<ulong>("InstanceManagerRights");
459 
460  b.Property<DateTimeOffset?>("LastPasswordUpdate");
461 
462  b.Property<string>("Name")
463  .IsRequired();
464 
465  b.Property<string>("PasswordHash");
466 
467  b.Property<string>("SystemIdentifier");
468 
469  b.HasKey("Id");
470 
471  b.HasIndex("CanonicalName")
472  .IsUnique();
473 
474  b.HasIndex("CreatedById");
475 
476  b.ToTable("Users");
477  });
478 
479  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
480  {
481  b.Property<long>("Id")
482  .ValueGeneratedOnAdd();
483 
484  b.Property<long?>("AlphaId");
485 
486  b.Property<bool>("AlphaIsActive");
487 
488  b.Property<long?>("BravoId");
489 
490  b.Property<long>("InstanceId");
491 
492  b.HasKey("Id");
493 
494  b.HasIndex("AlphaId");
495 
496  b.HasIndex("BravoId");
497 
498  b.HasIndex("InstanceId")
499  .IsUnique();
500 
501  b.ToTable("WatchdogReattachInformations");
502  });
503 
504  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
505  {
506  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
507  .WithMany("ChatSettings")
508  .HasForeignKey("InstanceId")
509  .OnDelete(DeleteBehavior.Cascade);
510  });
511 
512  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
513  {
514  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
515  .WithMany("Channels")
516  .HasForeignKey("ChatSettingsId")
517  .OnDelete(DeleteBehavior.Cascade);
518  });
519 
520  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
521  {
522  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
523  .WithOne()
524  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
525  .OnDelete(DeleteBehavior.Restrict);
526 
527  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
528  .WithMany("CompileJobs")
529  .HasForeignKey("RevisionInformationId")
530  .OnDelete(DeleteBehavior.Cascade);
531  });
532 
533  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
534  {
535  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
536  .WithOne("DreamDaemonSettings")
537  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
538  .OnDelete(DeleteBehavior.Cascade);
539  });
540 
541  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
542  {
543  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
544  .WithOne("DreamMakerSettings")
545  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
546  .OnDelete(DeleteBehavior.Cascade);
547  });
548 
549  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
550  {
551  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
552  .WithMany("InstanceUsers")
553  .HasForeignKey("InstanceId")
554  .OnDelete(DeleteBehavior.Cascade);
555 
556  b.HasOne("Tgstation.Server.Host.Models.User")
557  .WithMany("InstanceUsers")
558  .HasForeignKey("UserId")
559  .OnDelete(DeleteBehavior.Cascade);
560  });
561 
562  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
563  {
564  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
565  .WithMany()
566  .HasForeignKey("CancelledById");
567 
568  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
569  .WithMany("Jobs")
570  .HasForeignKey("InstanceId")
571  .OnDelete(DeleteBehavior.Cascade);
572 
573  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
574  .WithMany()
575  .HasForeignKey("StartedById")
576  .OnDelete(DeleteBehavior.Cascade);
577  });
578 
579  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
580  {
581  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
582  .WithMany()
583  .HasForeignKey("CompileJobId");
584  });
585 
586  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
587  {
588  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
589  .WithOne("RepositorySettings")
590  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
591  .OnDelete(DeleteBehavior.Cascade);
592  });
593 
594  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
595  {
596  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
597  .WithMany("ActiveTestMerges")
598  .HasForeignKey("RevisionInformationId")
599  .OnDelete(DeleteBehavior.Cascade);
600 
601  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
602  .WithMany("RevisonInformations")
603  .HasForeignKey("TestMergeId")
604  .OnDelete(DeleteBehavior.Cascade);
605  });
606 
607  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
608  {
609  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
610  .WithMany("RevisionInformations")
611  .HasForeignKey("InstanceId")
612  .OnDelete(DeleteBehavior.Cascade);
613  });
614 
615  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
616  {
617  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
618  .WithMany("TestMerges")
619  .HasForeignKey("MergedById")
620  .OnDelete(DeleteBehavior.Restrict);
621 
622  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
623  .WithOne("PrimaryTestMerge")
624  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
625  .OnDelete(DeleteBehavior.Restrict);
626  });
627 
628  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
629  {
630  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
631  .WithMany("CreatedUsers")
632  .HasForeignKey("CreatedById");
633  });
634 
635  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
636  {
637  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
638  .WithMany()
639  .HasForeignKey("AlphaId");
640 
641  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
642  .WithMany()
643  .HasForeignKey("BravoId");
644 
645  b.HasOne("Tgstation.Server.Host.Models.Instance")
646  .WithOne("WatchdogReattachInformation")
647  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
648  .OnDelete(DeleteBehavior.Cascade);
649  });
650 #pragma warning restore 612, 618
651  }
652  }
653 }
- +Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
6 
8 {
9  [DbContext(typeof(MySqlDatabaseContext))]
10  [Migration("20180918204520_MYNullableAndForeignKeyCleanup")]
11  partial class MYNullableAndForeignKeyCleanup
12  {
17  protected override void BuildTargetModel(ModelBuilder modelBuilder)
18  {
19 #pragma warning disable 612, 618
20  modelBuilder
21  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
22  .HasAnnotation("Relational:MaxIdentifierLength", 64);
23 
24  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
25  {
26  b.Property<long>("Id")
27  .ValueGeneratedOnAdd();
28 
29  b.Property<string>("ConnectionString")
30  .IsRequired();
31 
32  b.Property<bool?>("Enabled");
33 
34  b.Property<long>("InstanceId");
35 
36  b.Property<string>("Name")
37  .IsRequired();
38 
39  b.Property<int?>("Provider");
40 
41  b.HasKey("Id");
42 
43  b.HasIndex("InstanceId");
44 
45  b.HasIndex("Name")
46  .IsUnique();
47 
48  b.ToTable("ChatBots");
49  });
50 
51  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
52  {
53  b.Property<long>("Id")
54  .ValueGeneratedOnAdd();
55 
56  b.Property<long>("ChatSettingsId");
57 
58  b.Property<ulong?>("DiscordChannelId");
59 
60  b.Property<string>("IrcChannel");
61 
62  b.Property<bool?>("IsAdminChannel")
63  .IsRequired();
64 
65  b.Property<bool?>("IsUpdatesChannel")
66  .IsRequired();
67 
68  b.Property<bool?>("IsWatchdogChannel")
69  .IsRequired();
70 
71  b.Property<string>("Tag");
72 
73  b.HasKey("Id");
74 
75  b.HasIndex("ChatSettingsId", "DiscordChannelId")
76  .IsUnique();
77 
78  b.HasIndex("ChatSettingsId", "IrcChannel")
79  .IsUnique();
80 
81  b.ToTable("ChatChannels");
82  });
83 
84  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
85  {
86  b.Property<long>("Id")
87  .ValueGeneratedOnAdd();
88 
89  b.Property<string>("ByondVersion")
90  .IsRequired();
91 
92  b.Property<Guid?>("DirectoryName")
93  .IsRequired();
94 
95  b.Property<string>("DmeName")
96  .IsRequired();
97 
98  b.Property<long>("JobId");
99 
100  b.Property<int>("MinimumSecurityLevel");
101 
102  b.Property<string>("Output")
103  .IsRequired();
104 
105  b.Property<long>("RevisionInformationId");
106 
107  b.HasKey("Id");
108 
109  b.HasIndex("DirectoryName");
110 
111  b.HasIndex("JobId")
112  .IsUnique();
113 
114  b.HasIndex("RevisionInformationId");
115 
116  b.ToTable("CompileJobs");
117  });
118 
119  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
120  {
121  b.Property<long>("Id")
122  .ValueGeneratedOnAdd();
123 
124  b.Property<string>("AccessToken");
125 
126  b.Property<bool?>("AllowWebClient")
127  .IsRequired();
128 
129  b.Property<bool?>("AutoStart")
130  .IsRequired();
131 
132  b.Property<long>("InstanceId");
133 
134  b.Property<ushort?>("PrimaryPort")
135  .IsRequired();
136 
137  b.Property<int?>("ProcessId");
138 
139  b.Property<ushort?>("SecondaryPort")
140  .IsRequired();
141 
142  b.Property<int>("SecurityLevel");
143 
144  b.Property<bool?>("SoftRestart")
145  .IsRequired();
146 
147  b.Property<bool?>("SoftShutdown")
148  .IsRequired();
149 
150  b.Property<uint?>("StartupTimeout")
151  .IsRequired();
152 
153  b.HasKey("Id");
154 
155  b.HasIndex("InstanceId")
156  .IsUnique();
157 
158  b.ToTable("DreamDaemonSettings");
159  });
160 
161  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
162  {
163  b.Property<long>("Id")
164  .ValueGeneratedOnAdd();
165 
166  b.Property<ushort?>("ApiValidationPort")
167  .IsRequired();
168 
169  b.Property<int>("ApiValidationSecurityLevel");
170 
171  b.Property<long>("InstanceId");
172 
173  b.Property<string>("ProjectName");
174 
175  b.HasKey("Id");
176 
177  b.HasIndex("InstanceId")
178  .IsUnique();
179 
180  b.ToTable("DreamMakerSettings");
181  });
182 
183  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
184  {
185  b.Property<long>("Id")
186  .ValueGeneratedOnAdd();
187 
188  b.Property<uint?>("AutoUpdateInterval")
189  .IsRequired();
190 
191  b.Property<int>("ConfigurationType");
192 
193  b.Property<string>("Name")
194  .IsRequired();
195 
196  b.Property<bool?>("Online")
197  .IsRequired();
198 
199  b.Property<string>("Path")
200  .IsRequired();
201 
202  b.HasKey("Id");
203 
204  b.HasIndex("Path")
205  .IsUnique();
206 
207  b.ToTable("Instances");
208  });
209 
210  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
211  {
212  b.Property<long>("Id")
213  .ValueGeneratedOnAdd();
214 
215  b.Property<ulong>("ByondRights");
216 
217  b.Property<ulong>("ChatBotRights");
218 
219  b.Property<ulong>("ConfigurationRights");
220 
221  b.Property<ulong>("DreamDaemonRights");
222 
223  b.Property<ulong>("DreamMakerRights");
224 
225  b.Property<long>("InstanceId");
226 
227  b.Property<ulong>("InstanceUserRights");
228 
229  b.Property<ulong>("RepositoryRights");
230 
231  b.Property<long?>("UserId")
232  .IsRequired();
233 
234  b.HasKey("Id");
235 
236  b.HasIndex("InstanceId");
237 
238  b.HasIndex("UserId", "InstanceId")
239  .IsUnique();
240 
241  b.ToTable("InstanceUsers");
242  });
243 
244  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
245  {
246  b.Property<long>("Id")
247  .ValueGeneratedOnAdd();
248 
249  b.Property<ulong?>("CancelRight");
250 
251  b.Property<ulong?>("CancelRightsType");
252 
253  b.Property<bool?>("Cancelled")
254  .IsRequired();
255 
256  b.Property<long?>("CancelledById");
257 
258  b.Property<string>("Description")
259  .IsRequired();
260 
261  b.Property<string>("ExceptionDetails");
262 
263  b.Property<long>("InstanceId");
264 
265  b.Property<DateTimeOffset?>("StartedAt")
266  .IsRequired();
267 
268  b.Property<long>("StartedById");
269 
270  b.Property<DateTimeOffset?>("StoppedAt");
271 
272  b.HasKey("Id");
273 
274  b.HasIndex("CancelledById");
275 
276  b.HasIndex("InstanceId");
277 
278  b.HasIndex("StartedById");
279 
280  b.ToTable("Jobs");
281  });
282 
283  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
284  {
285  b.Property<long>("Id")
286  .ValueGeneratedOnAdd();
287 
288  b.Property<string>("AccessIdentifier")
289  .IsRequired();
290 
291  b.Property<string>("ChatChannelsJson")
292  .IsRequired();
293 
294  b.Property<string>("ChatCommandsJson")
295  .IsRequired();
296 
297  b.Property<long?>("CompileJobId");
298 
299  b.Property<bool>("IsPrimary");
300 
301  b.Property<ushort>("Port");
302 
303  b.Property<int>("ProcessId");
304 
305  b.Property<int>("RebootState");
306 
307  b.Property<string>("ServerCommandsJson")
308  .IsRequired();
309 
310  b.HasKey("Id");
311 
312  b.HasIndex("CompileJobId");
313 
314  b.ToTable("ReattachInformations");
315  });
316 
317  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
318  {
319  b.Property<long>("Id")
320  .ValueGeneratedOnAdd();
321 
322  b.Property<string>("AccessToken");
323 
324  b.Property<string>("AccessUser");
325 
326  b.Property<bool?>("AutoUpdatesKeepTestMerges")
327  .IsRequired();
328 
329  b.Property<bool?>("AutoUpdatesSynchronize")
330  .IsRequired();
331 
332  b.Property<string>("CommitterEmail")
333  .IsRequired();
334 
335  b.Property<string>("CommitterName")
336  .IsRequired();
337 
338  b.Property<long>("InstanceId");
339 
340  b.Property<bool?>("PushTestMergeCommits")
341  .IsRequired();
342 
343  b.Property<bool?>("ShowTestMergeCommitters")
344  .IsRequired();
345 
346  b.HasKey("Id");
347 
348  b.HasIndex("InstanceId")
349  .IsUnique();
350 
351  b.ToTable("RepositorySettings");
352  });
353 
354  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
355  {
356  b.Property<long>("Id")
357  .ValueGeneratedOnAdd();
358 
359  b.Property<long>("RevisionInformationId");
360 
361  b.Property<long>("TestMergeId");
362 
363  b.HasKey("Id");
364 
365  b.HasIndex("RevisionInformationId");
366 
367  b.HasIndex("TestMergeId");
368 
369  b.ToTable("RevInfoTestMerges");
370  });
371 
372  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
373  {
374  b.Property<long>("Id")
375  .ValueGeneratedOnAdd();
376 
377  b.Property<string>("CommitSha")
378  .IsRequired()
379  .HasMaxLength(40);
380 
381  b.Property<long>("InstanceId");
382 
383  b.Property<string>("OriginCommitSha")
384  .IsRequired()
385  .HasMaxLength(40);
386 
387  b.HasKey("Id");
388 
389  b.HasIndex("CommitSha")
390  .IsUnique();
391 
392  b.HasIndex("InstanceId");
393 
394  b.ToTable("RevisionInformations");
395  });
396 
397  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
398  {
399  b.Property<long>("Id")
400  .ValueGeneratedOnAdd();
401 
402  b.Property<string>("Author")
403  .IsRequired();
404 
405  b.Property<string>("BodyAtMerge")
406  .IsRequired();
407 
408  b.Property<string>("Comment");
409 
410  b.Property<DateTimeOffset>("MergedAt");
411 
412  b.Property<long>("MergedById");
413 
414  b.Property<int?>("Number")
415  .IsRequired();
416 
417  b.Property<long?>("PrimaryRevisionInformationId")
418  .IsRequired();
419 
420  b.Property<string>("PullRequestRevision")
421  .IsRequired();
422 
423  b.Property<string>("TitleAtMerge")
424  .IsRequired();
425 
426  b.Property<string>("Url")
427  .IsRequired();
428 
429  b.HasKey("Id");
430 
431  b.HasIndex("MergedById");
432 
433  b.HasIndex("PrimaryRevisionInformationId")
434  .IsUnique();
435 
436  b.ToTable("TestMerges");
437  });
438 
439  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
440  {
441  b.Property<long>("Id")
442  .ValueGeneratedOnAdd();
443 
444  b.Property<ulong>("AdministrationRights");
445 
446  b.Property<string>("CanonicalName")
447  .IsRequired();
448 
449  b.Property<DateTimeOffset?>("CreatedAt")
450  .IsRequired();
451 
452  b.Property<long?>("CreatedById");
453 
454  b.Property<bool?>("Enabled")
455  .IsRequired();
456 
457  b.Property<ulong>("InstanceManagerRights");
458 
459  b.Property<DateTimeOffset?>("LastPasswordUpdate");
460 
461  b.Property<string>("Name")
462  .IsRequired();
463 
464  b.Property<string>("PasswordHash");
465 
466  b.Property<string>("SystemIdentifier");
467 
468  b.HasKey("Id");
469 
470  b.HasIndex("CanonicalName")
471  .IsUnique();
472 
473  b.HasIndex("CreatedById");
474 
475  b.ToTable("Users");
476  });
477 
478  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
479  {
480  b.Property<long>("Id")
481  .ValueGeneratedOnAdd();
482 
483  b.Property<long?>("AlphaId");
484 
485  b.Property<bool>("AlphaIsActive");
486 
487  b.Property<long?>("BravoId");
488 
489  b.Property<long>("InstanceId");
490 
491  b.HasKey("Id");
492 
493  b.HasIndex("AlphaId");
494 
495  b.HasIndex("BravoId");
496 
497  b.HasIndex("InstanceId")
498  .IsUnique();
499 
500  b.ToTable("WatchdogReattachInformations");
501  });
502 
503  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
504  {
505  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
506  .WithMany("ChatSettings")
507  .HasForeignKey("InstanceId")
508  .OnDelete(DeleteBehavior.Cascade);
509  });
510 
511  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
512  {
513  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
514  .WithMany("Channels")
515  .HasForeignKey("ChatSettingsId")
516  .OnDelete(DeleteBehavior.Cascade);
517  });
518 
519  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
520  {
521  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
522  .WithOne()
523  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
524  .OnDelete(DeleteBehavior.Restrict);
525 
526  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
527  .WithMany("CompileJobs")
528  .HasForeignKey("RevisionInformationId")
529  .OnDelete(DeleteBehavior.Cascade);
530  });
531 
532  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
533  {
534  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
535  .WithOne("DreamDaemonSettings")
536  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
537  .OnDelete(DeleteBehavior.Cascade);
538  });
539 
540  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
541  {
542  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
543  .WithOne("DreamMakerSettings")
544  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
545  .OnDelete(DeleteBehavior.Cascade);
546  });
547 
548  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
549  {
550  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
551  .WithMany("InstanceUsers")
552  .HasForeignKey("InstanceId")
553  .OnDelete(DeleteBehavior.Cascade);
554 
555  b.HasOne("Tgstation.Server.Host.Models.User")
556  .WithMany("InstanceUsers")
557  .HasForeignKey("UserId")
558  .OnDelete(DeleteBehavior.Cascade);
559  });
560 
561  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
562  {
563  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
564  .WithMany()
565  .HasForeignKey("CancelledById");
566 
567  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
568  .WithMany("Jobs")
569  .HasForeignKey("InstanceId")
570  .OnDelete(DeleteBehavior.Cascade);
571 
572  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
573  .WithMany()
574  .HasForeignKey("StartedById")
575  .OnDelete(DeleteBehavior.Cascade);
576  });
577 
578  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
579  {
580  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
581  .WithMany()
582  .HasForeignKey("CompileJobId");
583  });
584 
585  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
586  {
587  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
588  .WithOne("RepositorySettings")
589  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
590  .OnDelete(DeleteBehavior.Cascade);
591  });
592 
593  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
594  {
595  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
596  .WithMany("ActiveTestMerges")
597  .HasForeignKey("RevisionInformationId")
598  .OnDelete(DeleteBehavior.Cascade);
599 
600  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
601  .WithMany("RevisonInformations")
602  .HasForeignKey("TestMergeId")
603  .OnDelete(DeleteBehavior.Cascade);
604  });
605 
606  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
607  {
608  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
609  .WithMany("RevisionInformations")
610  .HasForeignKey("InstanceId")
611  .OnDelete(DeleteBehavior.Cascade);
612  });
613 
614  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
615  {
616  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
617  .WithMany("TestMerges")
618  .HasForeignKey("MergedById")
619  .OnDelete(DeleteBehavior.Restrict);
620 
621  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
622  .WithOne("PrimaryTestMerge")
623  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
624  .OnDelete(DeleteBehavior.Restrict);
625  });
626 
627  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
628  {
629  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
630  .WithMany("CreatedUsers")
631  .HasForeignKey("CreatedById");
632  });
633 
634  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
635  {
636  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
637  .WithMany()
638  .HasForeignKey("AlphaId");
639 
640  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
641  .WithMany()
642  .HasForeignKey("BravoId");
643 
644  b.HasOne("Tgstation.Server.Host.Models.Instance")
645  .WithOne("WatchdogReattachInformation")
646  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
647  .OnDelete(DeleteBehavior.Cascade);
648  });
649 #pragma warning restore 612, 618
650  }
651  }
652 }
-
DatabaseContext<TParentContext> for MySQL
- - - - - + +
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MYNullableAndForeignKeyCleanup
 Cleans up of nullable columns and foreign keys MySQL/MariaDB More...
class  Tgstation.Server.Host.Database.Migrations.MYNullableAndForeignKeyCleanup
 Cleans up of nullable columns and foreign keys MySQL/MariaDB More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180918204520___m_y_nullable_and_foreign_key_cleanup_8cs_source.html b/20180918204520___m_y_nullable_and_foreign_key_cleanup_8cs_source.html index 887a5d4629..2be71a8d2c 100644 --- a/20180918204520___m_y_nullable_and_foreign_key_cleanup_8cs_source.html +++ b/20180918204520___m_y_nullable_and_foreign_key_cleanup_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180918204520_MYNullableAndForeignKeyCleanup.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180918204520_MYNullableAndForeignKeyCleanup.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,11 +71,11 @@ $(function() {
20180918204520_MYNullableAndForeignKeyCleanup.cs
-Go to the documentation of this file.
1 using System;
2 using Microsoft.EntityFrameworkCore.Migrations;
3 
5 {
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropForeignKey(
21  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInfor~",
22  table: "Instances");
23 
24  migrationBuilder.DropForeignKey(
25  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
26  table: "TestMerges");
27 
28  migrationBuilder.DropForeignKey(
29  name: "FK_CompileJobs_Jobs_JobId",
30  table: "CompileJobs");
31 
32  migrationBuilder.DropIndex(
33  name: "IX_Instances_WatchdogReattachInformationId",
34  table: "Instances");
35 
36  migrationBuilder.DropIndex(
37  name: "IX_CompileJobs_JobId",
38  table: "CompileJobs");
39 
40  migrationBuilder.DropColumn(
41  name: "WatchdogReattachInformationId",
42  table: "Instances");
43 
44  migrationBuilder.AddColumn<long>(
45  name: "InstanceId",
46  table: "WatchdogReattachInformations",
47  nullable: false,
48  defaultValue: 0L);
49 
50  migrationBuilder.AlterColumn<long>(
51  name: "PrimaryRevisionInformationId",
52  table: "TestMerges",
53  nullable: false,
54  oldClrType: typeof(long),
55  oldNullable: true);
56 
57  migrationBuilder.AlterColumn<string>(
58  name: "Output",
59  table: "CompileJobs",
60  nullable: false,
61  oldClrType: typeof(string),
62  oldNullable: true);
63 
64  migrationBuilder.AlterColumn<long>(
65  name: "JobId",
66  table: "CompileJobs",
67  nullable: false,
68  oldClrType: typeof(long),
69  oldNullable: true);
70 
71  migrationBuilder.AlterColumn<string>(
72  name: "DmeName",
73  table: "CompileJobs",
74  nullable: false,
75  oldClrType: typeof(string),
76  oldNullable: true);
77 
78  migrationBuilder.AlterColumn<Guid>(
79  name: "DirectoryName",
80  table: "CompileJobs",
81  nullable: false,
82  oldClrType: typeof(Guid),
83  oldNullable: true);
84 
85  migrationBuilder.CreateIndex(
86  name: "IX_WatchdogReattachInformations_InstanceId",
87  table: "WatchdogReattachInformations",
88  column: "InstanceId",
89  unique: true);
90 
91  migrationBuilder.CreateIndex(
92  name: "IX_CompileJobs_JobId",
93  table: "CompileJobs",
94  column: "JobId",
95  unique: true);
96 
97  migrationBuilder.AddForeignKey(
98  name: "FK_CompileJobs_Jobs_JobId",
99  table: "CompileJobs",
100  column: "JobId",
101  principalTable: "Jobs",
102  principalColumn: "Id",
103  onDelete: ReferentialAction.Restrict);
104 
105  migrationBuilder.AddForeignKey(
106  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
107  table: "TestMerges",
108  column: "PrimaryRevisionInformationId",
109  principalTable: "RevisionInformations",
110  principalColumn: "Id",
111  onDelete: ReferentialAction.Restrict);
112 
113  migrationBuilder.AddForeignKey(
114  name: "FK_WatchdogReattachInformations_Instances_InstanceId",
115  table: "WatchdogReattachInformations",
116  column: "InstanceId",
117  principalTable: "Instances",
118  principalColumn: "Id",
119  onDelete: ReferentialAction.Cascade);
120  }
121 
126  protected override void Down(MigrationBuilder migrationBuilder)
127  {
128  if (migrationBuilder == null)
129  throw new ArgumentNullException(nameof(migrationBuilder));
130 
131  migrationBuilder.DropForeignKey(
132  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
133  table: "TestMerges");
134 
135  migrationBuilder.DropForeignKey(
136  name: "FK_WatchdogReattachInformations_Instances_InstanceId",
137  table: "WatchdogReattachInformations");
138 
139  migrationBuilder.DropForeignKey(
140  name: "FK_CompileJobs_Jobs_JobId",
141  table: "CompileJobs");
142 
143  migrationBuilder.DropIndex(
144  name: "IX_WatchdogReattachInformations_InstanceId",
145  table: "WatchdogReattachInformations");
146 
147  migrationBuilder.DropIndex(
148  name: "IX_CompileJobs_JobId",
149  table: "CompileJobs");
150 
151  migrationBuilder.DropColumn(
152  name: "InstanceId",
153  table: "WatchdogReattachInformations");
154 
155  migrationBuilder.AlterColumn<long>(
156  name: "PrimaryRevisionInformationId",
157  table: "TestMerges",
158  nullable: true,
159  oldClrType: typeof(long));
160 
161  migrationBuilder.AddColumn<long>(
162  name: "WatchdogReattachInformationId",
163  table: "Instances",
164  nullable: true);
165 
166  migrationBuilder.AlterColumn<string>(
167  name: "Output",
168  table: "CompileJobs",
169  nullable: true,
170  oldClrType: typeof(string));
171 
172  migrationBuilder.AlterColumn<long>(
173  name: "JobId",
174  table: "CompileJobs",
175  nullable: true,
176  oldClrType: typeof(long));
177 
178  migrationBuilder.AlterColumn<string>(
179  name: "DmeName",
180  table: "CompileJobs",
181  nullable: true,
182  oldClrType: typeof(string));
183 
184  migrationBuilder.AlterColumn<Guid>(
185  name: "DirectoryName",
186  table: "CompileJobs",
187  nullable: true,
188  oldClrType: typeof(Guid));
189 
190  migrationBuilder.CreateIndex(
191  name: "IX_Instances_WatchdogReattachInformationId",
192  table: "Instances",
193  column: "WatchdogReattachInformationId");
194 
195  migrationBuilder.CreateIndex(
196  name: "IX_CompileJobs_JobId",
197  table: "CompileJobs",
198  column: "JobId");
199 
200  migrationBuilder.AddForeignKey(
201  name: "FK_CompileJobs_Jobs_JobId",
202  table: "CompileJobs",
203  column: "JobId",
204  principalTable: "Jobs",
205  principalColumn: "Id",
206  onDelete: ReferentialAction.Restrict);
207 
208  migrationBuilder.AddForeignKey(
209  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInfor~",
210  table: "Instances",
211  column: "WatchdogReattachInformationId",
212  principalTable: "WatchdogReattachInformations",
213  principalColumn: "Id",
214  onDelete: ReferentialAction.Restrict);
215 
216  migrationBuilder.AddForeignKey(
217  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
218  table: "TestMerges",
219  column: "PrimaryRevisionInformationId",
220  principalTable: "RevisionInformations",
221  principalColumn: "Id",
222  onDelete: ReferentialAction.SetNull);
223  }
224  }
225 }
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
- - -
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
- +Go to the documentation of this file.
1 using System;
2 using Microsoft.EntityFrameworkCore.Migrations;
3 
5 {
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropForeignKey(
21  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInfor~",
22  table: "Instances");
23 
24  migrationBuilder.DropForeignKey(
25  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
26  table: "TestMerges");
27 
28  migrationBuilder.DropForeignKey(
29  name: "FK_CompileJobs_Jobs_JobId",
30  table: "CompileJobs");
31 
32  migrationBuilder.DropIndex(
33  name: "IX_Instances_WatchdogReattachInformationId",
34  table: "Instances");
35 
36  migrationBuilder.DropIndex(
37  name: "IX_CompileJobs_JobId",
38  table: "CompileJobs");
39 
40  migrationBuilder.DropColumn(
41  name: "WatchdogReattachInformationId",
42  table: "Instances");
43 
44  migrationBuilder.AddColumn<long>(
45  name: "InstanceId",
46  table: "WatchdogReattachInformations",
47  nullable: false,
48  defaultValue: 0L);
49 
50  migrationBuilder.AlterColumn<long>(
51  name: "PrimaryRevisionInformationId",
52  table: "TestMerges",
53  nullable: false,
54  oldClrType: typeof(long),
55  oldNullable: true);
56 
57  migrationBuilder.AlterColumn<string>(
58  name: "Output",
59  table: "CompileJobs",
60  nullable: false,
61  oldClrType: typeof(string),
62  oldNullable: true);
63 
64  migrationBuilder.AlterColumn<long>(
65  name: "JobId",
66  table: "CompileJobs",
67  nullable: false,
68  oldClrType: typeof(long),
69  oldNullable: true);
70 
71  migrationBuilder.AlterColumn<string>(
72  name: "DmeName",
73  table: "CompileJobs",
74  nullable: false,
75  oldClrType: typeof(string),
76  oldNullable: true);
77 
78  migrationBuilder.AlterColumn<Guid>(
79  name: "DirectoryName",
80  table: "CompileJobs",
81  nullable: false,
82  oldClrType: typeof(Guid),
83  oldNullable: true);
84 
85  migrationBuilder.CreateIndex(
86  name: "IX_WatchdogReattachInformations_InstanceId",
87  table: "WatchdogReattachInformations",
88  column: "InstanceId",
89  unique: true);
90 
91  migrationBuilder.CreateIndex(
92  name: "IX_CompileJobs_JobId",
93  table: "CompileJobs",
94  column: "JobId",
95  unique: true);
96 
97  migrationBuilder.AddForeignKey(
98  name: "FK_CompileJobs_Jobs_JobId",
99  table: "CompileJobs",
100  column: "JobId",
101  principalTable: "Jobs",
102  principalColumn: "Id",
103  onDelete: ReferentialAction.Restrict);
104 
105  migrationBuilder.AddForeignKey(
106  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
107  table: "TestMerges",
108  column: "PrimaryRevisionInformationId",
109  principalTable: "RevisionInformations",
110  principalColumn: "Id",
111  onDelete: ReferentialAction.Restrict);
112 
113  migrationBuilder.AddForeignKey(
114  name: "FK_WatchdogReattachInformations_Instances_InstanceId",
115  table: "WatchdogReattachInformations",
116  column: "InstanceId",
117  principalTable: "Instances",
118  principalColumn: "Id",
119  onDelete: ReferentialAction.Cascade);
120  }
121 
126  protected override void Down(MigrationBuilder migrationBuilder)
127  {
128  if (migrationBuilder == null)
129  throw new ArgumentNullException(nameof(migrationBuilder));
130 
131  migrationBuilder.DropForeignKey(
132  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
133  table: "TestMerges");
134 
135  migrationBuilder.DropForeignKey(
136  name: "FK_WatchdogReattachInformations_Instances_InstanceId",
137  table: "WatchdogReattachInformations");
138 
139  migrationBuilder.DropForeignKey(
140  name: "FK_CompileJobs_Jobs_JobId",
141  table: "CompileJobs");
142 
143  migrationBuilder.DropIndex(
144  name: "IX_WatchdogReattachInformations_InstanceId",
145  table: "WatchdogReattachInformations");
146 
147  migrationBuilder.DropIndex(
148  name: "IX_CompileJobs_JobId",
149  table: "CompileJobs");
150 
151  migrationBuilder.DropColumn(
152  name: "InstanceId",
153  table: "WatchdogReattachInformations");
154 
155  migrationBuilder.AlterColumn<long>(
156  name: "PrimaryRevisionInformationId",
157  table: "TestMerges",
158  nullable: true,
159  oldClrType: typeof(long));
160 
161  migrationBuilder.AddColumn<long>(
162  name: "WatchdogReattachInformationId",
163  table: "Instances",
164  nullable: true);
165 
166  migrationBuilder.AlterColumn<string>(
167  name: "Output",
168  table: "CompileJobs",
169  nullable: true,
170  oldClrType: typeof(string));
171 
172  migrationBuilder.AlterColumn<long>(
173  name: "JobId",
174  table: "CompileJobs",
175  nullable: true,
176  oldClrType: typeof(long));
177 
178  migrationBuilder.AlterColumn<string>(
179  name: "DmeName",
180  table: "CompileJobs",
181  nullable: true,
182  oldClrType: typeof(string));
183 
184  migrationBuilder.AlterColumn<Guid>(
185  name: "DirectoryName",
186  table: "CompileJobs",
187  nullable: true,
188  oldClrType: typeof(Guid));
189 
190  migrationBuilder.CreateIndex(
191  name: "IX_Instances_WatchdogReattachInformationId",
192  table: "Instances",
193  column: "WatchdogReattachInformationId");
194 
195  migrationBuilder.CreateIndex(
196  name: "IX_CompileJobs_JobId",
197  table: "CompileJobs",
198  column: "JobId");
199 
200  migrationBuilder.AddForeignKey(
201  name: "FK_CompileJobs_Jobs_JobId",
202  table: "CompileJobs",
203  column: "JobId",
204  principalTable: "Jobs",
205  principalColumn: "Id",
206  onDelete: ReferentialAction.Restrict);
207 
208  migrationBuilder.AddForeignKey(
209  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInfor~",
210  table: "Instances",
211  column: "WatchdogReattachInformationId",
212  principalTable: "WatchdogReattachInformations",
213  principalColumn: "Id",
214  onDelete: ReferentialAction.Restrict);
215 
216  migrationBuilder.AddForeignKey(
217  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
218  table: "TestMerges",
219  column: "PrimaryRevisionInformationId",
220  principalTable: "RevisionInformations",
221  principalColumn: "Id",
222  onDelete: ReferentialAction.SetNull);
223  }
224  }
225 }
+
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
+
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
+ +
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MSNullableAndForeignKeyCleanup
 Cleans up of nullable columns and foreign keys MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MSNullableAndForeignKeyCleanup
 Cleans up of nullable columns and foreign keys MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180918205224___m_s_nullable_and_foreign_key_cleanup_8_designer_8cs_source.html b/20180918205224___m_s_nullable_and_foreign_key_cleanup_8_designer_8cs_source.html index a1ad31d5cf..5c88b98efb 100644 --- a/20180918205224___m_s_nullable_and_foreign_key_cleanup_8_designer_8cs_source.html +++ b/20180918205224___m_s_nullable_and_foreign_key_cleanup_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180918205224_MSNullableAndForeignKeyCleanup.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180918205224_MSNullableAndForeignKeyCleanup.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20180918205224_MSNullableAndForeignKeyCleanup.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
9 
11 {
13  [Migration("20180918205224_MSNullableAndForeignKeyCleanup")]
14  partial class MSNullableAndForeignKeyCleanup
15  {
20  protected override void BuildTargetModel(ModelBuilder modelBuilder)
21  {
22 #pragma warning disable 612, 618
23  modelBuilder
24  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
25  .HasAnnotation("Relational:MaxIdentifierLength", 128)
26  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
27 
28  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
29  {
30  b.Property<long>("Id")
31  .ValueGeneratedOnAdd()
32  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
33 
34  b.Property<string>("ConnectionString")
35  .IsRequired();
36 
37  b.Property<bool?>("Enabled");
38 
39  b.Property<long>("InstanceId");
40 
41  b.Property<string>("Name")
42  .IsRequired();
43 
44  b.Property<int?>("Provider");
45 
46  b.HasKey("Id");
47 
48  b.HasIndex("InstanceId");
49 
50  b.HasIndex("Name")
51  .IsUnique();
52 
53  b.ToTable("ChatBots");
54  });
55 
56  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
57  {
58  b.Property<long>("Id")
59  .ValueGeneratedOnAdd()
60  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
61 
62  b.Property<long>("ChatSettingsId");
63 
64  b.Property<decimal?>("DiscordChannelId")
65  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
66 
67  b.Property<string>("IrcChannel");
68 
69  b.Property<bool?>("IsAdminChannel")
70  .IsRequired();
71 
72  b.Property<bool?>("IsUpdatesChannel")
73  .IsRequired();
74 
75  b.Property<bool?>("IsWatchdogChannel")
76  .IsRequired();
77 
78  b.Property<string>("Tag");
79 
80  b.HasKey("Id");
81 
82  b.HasIndex("ChatSettingsId", "DiscordChannelId")
83  .IsUnique()
84  .HasFilter("[DiscordChannelId] IS NOT NULL");
85 
86  b.HasIndex("ChatSettingsId", "IrcChannel")
87  .IsUnique()
88  .HasFilter("[IrcChannel] IS NOT NULL");
89 
90  b.ToTable("ChatChannels");
91  });
92 
93  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
94  {
95  b.Property<long>("Id")
96  .ValueGeneratedOnAdd()
97  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
98 
99  b.Property<string>("ByondVersion")
100  .IsRequired();
101 
102  b.Property<Guid?>("DirectoryName")
103  .IsRequired();
104 
105  b.Property<string>("DmeName")
106  .IsRequired();
107 
108  b.Property<long>("JobId");
109 
110  b.Property<int>("MinimumSecurityLevel");
111 
112  b.Property<string>("Output")
113  .IsRequired();
114 
115  b.Property<long>("RevisionInformationId");
116 
117  b.HasKey("Id");
118 
119  b.HasIndex("DirectoryName");
120 
121  b.HasIndex("JobId")
122  .IsUnique();
123 
124  b.HasIndex("RevisionInformationId");
125 
126  b.ToTable("CompileJobs");
127  });
128 
129  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
130  {
131  b.Property<long>("Id")
132  .ValueGeneratedOnAdd()
133  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
134 
135  b.Property<string>("AccessToken");
136 
137  b.Property<bool?>("AllowWebClient")
138  .IsRequired();
139 
140  b.Property<bool?>("AutoStart")
141  .IsRequired();
142 
143  b.Property<long>("InstanceId");
144 
145  b.Property<int>("PrimaryPort");
146 
147  b.Property<int?>("ProcessId");
148 
149  b.Property<int>("SecondaryPort");
150 
151  b.Property<int>("SecurityLevel");
152 
153  b.Property<bool?>("SoftRestart")
154  .IsRequired();
155 
156  b.Property<bool?>("SoftShutdown")
157  .IsRequired();
158 
159  b.Property<long>("StartupTimeout");
160 
161  b.HasKey("Id");
162 
163  b.HasIndex("InstanceId")
164  .IsUnique();
165 
166  b.ToTable("DreamDaemonSettings");
167  });
168 
169  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
170  {
171  b.Property<long>("Id")
172  .ValueGeneratedOnAdd()
173  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
174 
175  b.Property<int>("ApiValidationPort");
176 
177  b.Property<int>("ApiValidationSecurityLevel");
178 
179  b.Property<long>("InstanceId");
180 
181  b.Property<string>("ProjectName");
182 
183  b.HasKey("Id");
184 
185  b.HasIndex("InstanceId")
186  .IsUnique();
187 
188  b.ToTable("DreamMakerSettings");
189  });
190 
191  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
192  {
193  b.Property<long>("Id")
194  .ValueGeneratedOnAdd()
195  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
196 
197  b.Property<long>("AutoUpdateInterval");
198 
199  b.Property<int>("ConfigurationType");
200 
201  b.Property<string>("Name")
202  .IsRequired();
203 
204  b.Property<bool?>("Online")
205  .IsRequired();
206 
207  b.Property<string>("Path")
208  .IsRequired();
209 
210  b.HasKey("Id");
211 
212  b.HasIndex("Path")
213  .IsUnique();
214 
215  b.ToTable("Instances");
216  });
217 
218  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
219  {
220  b.Property<long>("Id")
221  .ValueGeneratedOnAdd()
222  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
223 
224  b.Property<decimal>("ByondRights")
225  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
226 
227  b.Property<decimal>("ChatBotRights")
228  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
229 
230  b.Property<decimal>("ConfigurationRights")
231  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
232 
233  b.Property<decimal>("DreamDaemonRights")
234  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
235 
236  b.Property<decimal>("DreamMakerRights")
237  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
238 
239  b.Property<long>("InstanceId");
240 
241  b.Property<decimal>("InstanceUserRights")
242  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
243 
244  b.Property<decimal>("RepositoryRights")
245  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
246 
247  b.Property<long?>("UserId")
248  .IsRequired();
249 
250  b.HasKey("Id");
251 
252  b.HasIndex("InstanceId");
253 
254  b.HasIndex("UserId", "InstanceId")
255  .IsUnique();
256 
257  b.ToTable("InstanceUsers");
258  });
259 
260  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
261  {
262  b.Property<long>("Id")
263  .ValueGeneratedOnAdd()
264  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
265 
266  b.Property<decimal?>("CancelRight")
267  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
268 
269  b.Property<decimal?>("CancelRightsType")
270  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
271 
272  b.Property<bool?>("Cancelled")
273  .IsRequired();
274 
275  b.Property<long?>("CancelledById");
276 
277  b.Property<string>("Description")
278  .IsRequired();
279 
280  b.Property<string>("ExceptionDetails");
281 
282  b.Property<long>("InstanceId");
283 
284  b.Property<DateTimeOffset?>("StartedAt")
285  .IsRequired();
286 
287  b.Property<long>("StartedById");
288 
289  b.Property<DateTimeOffset?>("StoppedAt");
290 
291  b.HasKey("Id");
292 
293  b.HasIndex("CancelledById");
294 
295  b.HasIndex("InstanceId");
296 
297  b.HasIndex("StartedById");
298 
299  b.ToTable("Jobs");
300  });
301 
302  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
303  {
304  b.Property<long>("Id")
305  .ValueGeneratedOnAdd()
306  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
307 
308  b.Property<string>("AccessIdentifier")
309  .IsRequired();
310 
311  b.Property<string>("ChatChannelsJson")
312  .IsRequired();
313 
314  b.Property<string>("ChatCommandsJson")
315  .IsRequired();
316 
317  b.Property<long?>("CompileJobId");
318 
319  b.Property<bool>("IsPrimary");
320 
321  b.Property<int>("Port");
322 
323  b.Property<int>("ProcessId");
324 
325  b.Property<int>("RebootState");
326 
327  b.Property<string>("ServerCommandsJson")
328  .IsRequired();
329 
330  b.HasKey("Id");
331 
332  b.HasIndex("CompileJobId");
333 
334  b.ToTable("ReattachInformations");
335  });
336 
337  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
338  {
339  b.Property<long>("Id")
340  .ValueGeneratedOnAdd()
341  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
342 
343  b.Property<string>("AccessToken");
344 
345  b.Property<string>("AccessUser");
346 
347  b.Property<bool?>("AutoUpdatesKeepTestMerges")
348  .IsRequired();
349 
350  b.Property<bool?>("AutoUpdatesSynchronize")
351  .IsRequired();
352 
353  b.Property<string>("CommitterEmail")
354  .IsRequired();
355 
356  b.Property<string>("CommitterName")
357  .IsRequired();
358 
359  b.Property<long>("InstanceId");
360 
361  b.Property<bool?>("PushTestMergeCommits")
362  .IsRequired();
363 
364  b.Property<bool?>("ShowTestMergeCommitters")
365  .IsRequired();
366 
367  b.HasKey("Id");
368 
369  b.HasIndex("InstanceId")
370  .IsUnique();
371 
372  b.ToTable("RepositorySettings");
373  });
374 
375  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
376  {
377  b.Property<long>("Id")
378  .ValueGeneratedOnAdd()
379  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
380 
381  b.Property<long>("RevisionInformationId");
382 
383  b.Property<long>("TestMergeId");
384 
385  b.HasKey("Id");
386 
387  b.HasIndex("RevisionInformationId");
388 
389  b.HasIndex("TestMergeId");
390 
391  b.ToTable("RevInfoTestMerges");
392  });
393 
394  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
395  {
396  b.Property<long>("Id")
397  .ValueGeneratedOnAdd()
398  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
399 
400  b.Property<string>("CommitSha")
401  .IsRequired()
402  .HasMaxLength(40);
403 
404  b.Property<long>("InstanceId");
405 
406  b.Property<string>("OriginCommitSha")
407  .IsRequired()
408  .HasMaxLength(40);
409 
410  b.HasKey("Id");
411 
412  b.HasIndex("CommitSha")
413  .IsUnique();
414 
415  b.HasIndex("InstanceId");
416 
417  b.ToTable("RevisionInformations");
418  });
419 
420  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
421  {
422  b.Property<long>("Id")
423  .ValueGeneratedOnAdd()
424  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
425 
426  b.Property<string>("Author")
427  .IsRequired();
428 
429  b.Property<string>("BodyAtMerge")
430  .IsRequired();
431 
432  b.Property<string>("Comment");
433 
434  b.Property<DateTimeOffset>("MergedAt");
435 
436  b.Property<long>("MergedById");
437 
438  b.Property<int?>("Number")
439  .IsRequired();
440 
441  b.Property<long?>("PrimaryRevisionInformationId")
442  .IsRequired();
443 
444  b.Property<string>("PullRequestRevision")
445  .IsRequired();
446 
447  b.Property<string>("TitleAtMerge")
448  .IsRequired();
449 
450  b.Property<string>("Url")
451  .IsRequired();
452 
453  b.HasKey("Id");
454 
455  b.HasIndex("MergedById");
456 
457  b.HasIndex("PrimaryRevisionInformationId")
458  .IsUnique();
459 
460  b.ToTable("TestMerges");
461  });
462 
463  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
464  {
465  b.Property<long>("Id")
466  .ValueGeneratedOnAdd()
467  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
468 
469  b.Property<decimal>("AdministrationRights")
470  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
471 
472  b.Property<string>("CanonicalName")
473  .IsRequired();
474 
475  b.Property<DateTimeOffset?>("CreatedAt")
476  .IsRequired();
477 
478  b.Property<long?>("CreatedById");
479 
480  b.Property<bool?>("Enabled")
481  .IsRequired();
482 
483  b.Property<decimal>("InstanceManagerRights")
484  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
485 
486  b.Property<DateTimeOffset?>("LastPasswordUpdate");
487 
488  b.Property<string>("Name")
489  .IsRequired();
490 
491  b.Property<string>("PasswordHash");
492 
493  b.Property<string>("SystemIdentifier");
494 
495  b.HasKey("Id");
496 
497  b.HasIndex("CanonicalName")
498  .IsUnique();
499 
500  b.HasIndex("CreatedById");
501 
502  b.ToTable("Users");
503  });
504 
505  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
506  {
507  b.Property<long>("Id")
508  .ValueGeneratedOnAdd()
509  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
510 
511  b.Property<long?>("AlphaId");
512 
513  b.Property<bool>("AlphaIsActive");
514 
515  b.Property<long?>("BravoId");
516 
517  b.Property<long>("InstanceId");
518 
519  b.HasKey("Id");
520 
521  b.HasIndex("AlphaId");
522 
523  b.HasIndex("BravoId");
524 
525  b.HasIndex("InstanceId")
526  .IsUnique();
527 
528  b.ToTable("WatchdogReattachInformations");
529  });
530 
531  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
532  {
533  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
534  .WithMany("ChatSettings")
535  .HasForeignKey("InstanceId")
536  .OnDelete(DeleteBehavior.Cascade);
537  });
538 
539  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
540  {
541  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
542  .WithMany("Channels")
543  .HasForeignKey("ChatSettingsId")
544  .OnDelete(DeleteBehavior.Cascade);
545  });
546 
547  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
548  {
549  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
550  .WithOne()
551  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
552  .OnDelete(DeleteBehavior.Restrict);
553 
554  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
555  .WithMany("CompileJobs")
556  .HasForeignKey("RevisionInformationId")
557  .OnDelete(DeleteBehavior.Cascade);
558  });
559 
560  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
561  {
562  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
563  .WithOne("DreamDaemonSettings")
564  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
565  .OnDelete(DeleteBehavior.Cascade);
566  });
567 
568  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
569  {
570  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
571  .WithOne("DreamMakerSettings")
572  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
573  .OnDelete(DeleteBehavior.Cascade);
574  });
575 
576  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
577  {
578  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
579  .WithMany("InstanceUsers")
580  .HasForeignKey("InstanceId")
581  .OnDelete(DeleteBehavior.Cascade);
582 
583  b.HasOne("Tgstation.Server.Host.Models.User")
584  .WithMany("InstanceUsers")
585  .HasForeignKey("UserId")
586  .OnDelete(DeleteBehavior.Cascade);
587  });
588 
589  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
590  {
591  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
592  .WithMany()
593  .HasForeignKey("CancelledById");
594 
595  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
596  .WithMany("Jobs")
597  .HasForeignKey("InstanceId")
598  .OnDelete(DeleteBehavior.Cascade);
599 
600  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
601  .WithMany()
602  .HasForeignKey("StartedById")
603  .OnDelete(DeleteBehavior.Cascade);
604  });
605 
606  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
607  {
608  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
609  .WithMany()
610  .HasForeignKey("CompileJobId");
611  });
612 
613  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
614  {
615  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
616  .WithOne("RepositorySettings")
617  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
618  .OnDelete(DeleteBehavior.Cascade);
619  });
620 
621  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
622  {
623  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
624  .WithMany("ActiveTestMerges")
625  .HasForeignKey("RevisionInformationId")
626  .OnDelete(DeleteBehavior.Cascade);
627 
628  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
629  .WithMany("RevisonInformations")
630  .HasForeignKey("TestMergeId")
631  .OnDelete(DeleteBehavior.Cascade);
632  });
633 
634  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
635  {
636  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
637  .WithMany("RevisionInformations")
638  .HasForeignKey("InstanceId")
639  .OnDelete(DeleteBehavior.Cascade);
640  });
641 
642  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
643  {
644  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
645  .WithMany("TestMerges")
646  .HasForeignKey("MergedById")
647  .OnDelete(DeleteBehavior.Restrict);
648 
649  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
650  .WithOne("PrimaryTestMerge")
651  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
652  .OnDelete(DeleteBehavior.Restrict);
653  });
654 
655  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
656  {
657  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
658  .WithMany("CreatedUsers")
659  .HasForeignKey("CreatedById");
660  });
661 
662  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
663  {
664  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
665  .WithMany()
666  .HasForeignKey("AlphaId");
667 
668  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
669  .WithMany()
670  .HasForeignKey("BravoId");
671 
672  b.HasOne("Tgstation.Server.Host.Models.Instance")
673  .WithOne("WatchdogReattachInformation")
674  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
675  .OnDelete(DeleteBehavior.Cascade);
676  });
677 #pragma warning restore 612, 618
678  }
679  }
680 }
- +Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
8 
10 {
11  [DbContext(typeof(SqlServerDatabaseContext))]
12  [Migration("20180918205224_MSNullableAndForeignKeyCleanup")]
13  partial class MSNullableAndForeignKeyCleanup
14  {
19  protected override void BuildTargetModel(ModelBuilder modelBuilder)
20  {
21 #pragma warning disable 612, 618
22  modelBuilder
23  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
24  .HasAnnotation("Relational:MaxIdentifierLength", 128)
25  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
26 
27  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
28  {
29  b.Property<long>("Id")
30  .ValueGeneratedOnAdd()
31  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
32 
33  b.Property<string>("ConnectionString")
34  .IsRequired();
35 
36  b.Property<bool?>("Enabled");
37 
38  b.Property<long>("InstanceId");
39 
40  b.Property<string>("Name")
41  .IsRequired();
42 
43  b.Property<int?>("Provider");
44 
45  b.HasKey("Id");
46 
47  b.HasIndex("InstanceId");
48 
49  b.HasIndex("Name")
50  .IsUnique();
51 
52  b.ToTable("ChatBots");
53  });
54 
55  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
56  {
57  b.Property<long>("Id")
58  .ValueGeneratedOnAdd()
59  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
60 
61  b.Property<long>("ChatSettingsId");
62 
63  b.Property<decimal?>("DiscordChannelId")
64  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
65 
66  b.Property<string>("IrcChannel");
67 
68  b.Property<bool?>("IsAdminChannel")
69  .IsRequired();
70 
71  b.Property<bool?>("IsUpdatesChannel")
72  .IsRequired();
73 
74  b.Property<bool?>("IsWatchdogChannel")
75  .IsRequired();
76 
77  b.Property<string>("Tag");
78 
79  b.HasKey("Id");
80 
81  b.HasIndex("ChatSettingsId", "DiscordChannelId")
82  .IsUnique()
83  .HasFilter("[DiscordChannelId] IS NOT NULL");
84 
85  b.HasIndex("ChatSettingsId", "IrcChannel")
86  .IsUnique()
87  .HasFilter("[IrcChannel] IS NOT NULL");
88 
89  b.ToTable("ChatChannels");
90  });
91 
92  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
93  {
94  b.Property<long>("Id")
95  .ValueGeneratedOnAdd()
96  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
97 
98  b.Property<string>("ByondVersion")
99  .IsRequired();
100 
101  b.Property<Guid?>("DirectoryName")
102  .IsRequired();
103 
104  b.Property<string>("DmeName")
105  .IsRequired();
106 
107  b.Property<long>("JobId");
108 
109  b.Property<int>("MinimumSecurityLevel");
110 
111  b.Property<string>("Output")
112  .IsRequired();
113 
114  b.Property<long>("RevisionInformationId");
115 
116  b.HasKey("Id");
117 
118  b.HasIndex("DirectoryName");
119 
120  b.HasIndex("JobId")
121  .IsUnique();
122 
123  b.HasIndex("RevisionInformationId");
124 
125  b.ToTable("CompileJobs");
126  });
127 
128  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
129  {
130  b.Property<long>("Id")
131  .ValueGeneratedOnAdd()
132  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
133 
134  b.Property<string>("AccessToken");
135 
136  b.Property<bool?>("AllowWebClient")
137  .IsRequired();
138 
139  b.Property<bool?>("AutoStart")
140  .IsRequired();
141 
142  b.Property<long>("InstanceId");
143 
144  b.Property<int>("PrimaryPort");
145 
146  b.Property<int?>("ProcessId");
147 
148  b.Property<int>("SecondaryPort");
149 
150  b.Property<int>("SecurityLevel");
151 
152  b.Property<bool?>("SoftRestart")
153  .IsRequired();
154 
155  b.Property<bool?>("SoftShutdown")
156  .IsRequired();
157 
158  b.Property<long>("StartupTimeout");
159 
160  b.HasKey("Id");
161 
162  b.HasIndex("InstanceId")
163  .IsUnique();
164 
165  b.ToTable("DreamDaemonSettings");
166  });
167 
168  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
169  {
170  b.Property<long>("Id")
171  .ValueGeneratedOnAdd()
172  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
173 
174  b.Property<int>("ApiValidationPort");
175 
176  b.Property<int>("ApiValidationSecurityLevel");
177 
178  b.Property<long>("InstanceId");
179 
180  b.Property<string>("ProjectName");
181 
182  b.HasKey("Id");
183 
184  b.HasIndex("InstanceId")
185  .IsUnique();
186 
187  b.ToTable("DreamMakerSettings");
188  });
189 
190  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
191  {
192  b.Property<long>("Id")
193  .ValueGeneratedOnAdd()
194  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
195 
196  b.Property<long>("AutoUpdateInterval");
197 
198  b.Property<int>("ConfigurationType");
199 
200  b.Property<string>("Name")
201  .IsRequired();
202 
203  b.Property<bool?>("Online")
204  .IsRequired();
205 
206  b.Property<string>("Path")
207  .IsRequired();
208 
209  b.HasKey("Id");
210 
211  b.HasIndex("Path")
212  .IsUnique();
213 
214  b.ToTable("Instances");
215  });
216 
217  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
218  {
219  b.Property<long>("Id")
220  .ValueGeneratedOnAdd()
221  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
222 
223  b.Property<decimal>("ByondRights")
224  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
225 
226  b.Property<decimal>("ChatBotRights")
227  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
228 
229  b.Property<decimal>("ConfigurationRights")
230  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
231 
232  b.Property<decimal>("DreamDaemonRights")
233  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
234 
235  b.Property<decimal>("DreamMakerRights")
236  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
237 
238  b.Property<long>("InstanceId");
239 
240  b.Property<decimal>("InstanceUserRights")
241  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
242 
243  b.Property<decimal>("RepositoryRights")
244  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
245 
246  b.Property<long?>("UserId")
247  .IsRequired();
248 
249  b.HasKey("Id");
250 
251  b.HasIndex("InstanceId");
252 
253  b.HasIndex("UserId", "InstanceId")
254  .IsUnique();
255 
256  b.ToTable("InstanceUsers");
257  });
258 
259  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
260  {
261  b.Property<long>("Id")
262  .ValueGeneratedOnAdd()
263  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
264 
265  b.Property<decimal?>("CancelRight")
266  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
267 
268  b.Property<decimal?>("CancelRightsType")
269  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
270 
271  b.Property<bool?>("Cancelled")
272  .IsRequired();
273 
274  b.Property<long?>("CancelledById");
275 
276  b.Property<string>("Description")
277  .IsRequired();
278 
279  b.Property<string>("ExceptionDetails");
280 
281  b.Property<long>("InstanceId");
282 
283  b.Property<DateTimeOffset?>("StartedAt")
284  .IsRequired();
285 
286  b.Property<long>("StartedById");
287 
288  b.Property<DateTimeOffset?>("StoppedAt");
289 
290  b.HasKey("Id");
291 
292  b.HasIndex("CancelledById");
293 
294  b.HasIndex("InstanceId");
295 
296  b.HasIndex("StartedById");
297 
298  b.ToTable("Jobs");
299  });
300 
301  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
302  {
303  b.Property<long>("Id")
304  .ValueGeneratedOnAdd()
305  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
306 
307  b.Property<string>("AccessIdentifier")
308  .IsRequired();
309 
310  b.Property<string>("ChatChannelsJson")
311  .IsRequired();
312 
313  b.Property<string>("ChatCommandsJson")
314  .IsRequired();
315 
316  b.Property<long?>("CompileJobId");
317 
318  b.Property<bool>("IsPrimary");
319 
320  b.Property<int>("Port");
321 
322  b.Property<int>("ProcessId");
323 
324  b.Property<int>("RebootState");
325 
326  b.Property<string>("ServerCommandsJson")
327  .IsRequired();
328 
329  b.HasKey("Id");
330 
331  b.HasIndex("CompileJobId");
332 
333  b.ToTable("ReattachInformations");
334  });
335 
336  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
337  {
338  b.Property<long>("Id")
339  .ValueGeneratedOnAdd()
340  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
341 
342  b.Property<string>("AccessToken");
343 
344  b.Property<string>("AccessUser");
345 
346  b.Property<bool?>("AutoUpdatesKeepTestMerges")
347  .IsRequired();
348 
349  b.Property<bool?>("AutoUpdatesSynchronize")
350  .IsRequired();
351 
352  b.Property<string>("CommitterEmail")
353  .IsRequired();
354 
355  b.Property<string>("CommitterName")
356  .IsRequired();
357 
358  b.Property<long>("InstanceId");
359 
360  b.Property<bool?>("PushTestMergeCommits")
361  .IsRequired();
362 
363  b.Property<bool?>("ShowTestMergeCommitters")
364  .IsRequired();
365 
366  b.HasKey("Id");
367 
368  b.HasIndex("InstanceId")
369  .IsUnique();
370 
371  b.ToTable("RepositorySettings");
372  });
373 
374  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
375  {
376  b.Property<long>("Id")
377  .ValueGeneratedOnAdd()
378  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
379 
380  b.Property<long>("RevisionInformationId");
381 
382  b.Property<long>("TestMergeId");
383 
384  b.HasKey("Id");
385 
386  b.HasIndex("RevisionInformationId");
387 
388  b.HasIndex("TestMergeId");
389 
390  b.ToTable("RevInfoTestMerges");
391  });
392 
393  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
394  {
395  b.Property<long>("Id")
396  .ValueGeneratedOnAdd()
397  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
398 
399  b.Property<string>("CommitSha")
400  .IsRequired()
401  .HasMaxLength(40);
402 
403  b.Property<long>("InstanceId");
404 
405  b.Property<string>("OriginCommitSha")
406  .IsRequired()
407  .HasMaxLength(40);
408 
409  b.HasKey("Id");
410 
411  b.HasIndex("CommitSha")
412  .IsUnique();
413 
414  b.HasIndex("InstanceId");
415 
416  b.ToTable("RevisionInformations");
417  });
418 
419  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
420  {
421  b.Property<long>("Id")
422  .ValueGeneratedOnAdd()
423  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
424 
425  b.Property<string>("Author")
426  .IsRequired();
427 
428  b.Property<string>("BodyAtMerge")
429  .IsRequired();
430 
431  b.Property<string>("Comment");
432 
433  b.Property<DateTimeOffset>("MergedAt");
434 
435  b.Property<long>("MergedById");
436 
437  b.Property<int?>("Number")
438  .IsRequired();
439 
440  b.Property<long?>("PrimaryRevisionInformationId")
441  .IsRequired();
442 
443  b.Property<string>("PullRequestRevision")
444  .IsRequired();
445 
446  b.Property<string>("TitleAtMerge")
447  .IsRequired();
448 
449  b.Property<string>("Url")
450  .IsRequired();
451 
452  b.HasKey("Id");
453 
454  b.HasIndex("MergedById");
455 
456  b.HasIndex("PrimaryRevisionInformationId")
457  .IsUnique();
458 
459  b.ToTable("TestMerges");
460  });
461 
462  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
463  {
464  b.Property<long>("Id")
465  .ValueGeneratedOnAdd()
466  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
467 
468  b.Property<decimal>("AdministrationRights")
469  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
470 
471  b.Property<string>("CanonicalName")
472  .IsRequired();
473 
474  b.Property<DateTimeOffset?>("CreatedAt")
475  .IsRequired();
476 
477  b.Property<long?>("CreatedById");
478 
479  b.Property<bool?>("Enabled")
480  .IsRequired();
481 
482  b.Property<decimal>("InstanceManagerRights")
483  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
484 
485  b.Property<DateTimeOffset?>("LastPasswordUpdate");
486 
487  b.Property<string>("Name")
488  .IsRequired();
489 
490  b.Property<string>("PasswordHash");
491 
492  b.Property<string>("SystemIdentifier");
493 
494  b.HasKey("Id");
495 
496  b.HasIndex("CanonicalName")
497  .IsUnique();
498 
499  b.HasIndex("CreatedById");
500 
501  b.ToTable("Users");
502  });
503 
504  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
505  {
506  b.Property<long>("Id")
507  .ValueGeneratedOnAdd()
508  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
509 
510  b.Property<long?>("AlphaId");
511 
512  b.Property<bool>("AlphaIsActive");
513 
514  b.Property<long?>("BravoId");
515 
516  b.Property<long>("InstanceId");
517 
518  b.HasKey("Id");
519 
520  b.HasIndex("AlphaId");
521 
522  b.HasIndex("BravoId");
523 
524  b.HasIndex("InstanceId")
525  .IsUnique();
526 
527  b.ToTable("WatchdogReattachInformations");
528  });
529 
530  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
531  {
532  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
533  .WithMany("ChatSettings")
534  .HasForeignKey("InstanceId")
535  .OnDelete(DeleteBehavior.Cascade);
536  });
537 
538  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
539  {
540  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
541  .WithMany("Channels")
542  .HasForeignKey("ChatSettingsId")
543  .OnDelete(DeleteBehavior.Cascade);
544  });
545 
546  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
547  {
548  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
549  .WithOne()
550  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
551  .OnDelete(DeleteBehavior.Restrict);
552 
553  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
554  .WithMany("CompileJobs")
555  .HasForeignKey("RevisionInformationId")
556  .OnDelete(DeleteBehavior.Cascade);
557  });
558 
559  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
560  {
561  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
562  .WithOne("DreamDaemonSettings")
563  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
564  .OnDelete(DeleteBehavior.Cascade);
565  });
566 
567  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
568  {
569  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
570  .WithOne("DreamMakerSettings")
571  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
572  .OnDelete(DeleteBehavior.Cascade);
573  });
574 
575  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
576  {
577  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
578  .WithMany("InstanceUsers")
579  .HasForeignKey("InstanceId")
580  .OnDelete(DeleteBehavior.Cascade);
581 
582  b.HasOne("Tgstation.Server.Host.Models.User")
583  .WithMany("InstanceUsers")
584  .HasForeignKey("UserId")
585  .OnDelete(DeleteBehavior.Cascade);
586  });
587 
588  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
589  {
590  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
591  .WithMany()
592  .HasForeignKey("CancelledById");
593 
594  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
595  .WithMany("Jobs")
596  .HasForeignKey("InstanceId")
597  .OnDelete(DeleteBehavior.Cascade);
598 
599  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
600  .WithMany()
601  .HasForeignKey("StartedById")
602  .OnDelete(DeleteBehavior.Cascade);
603  });
604 
605  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
606  {
607  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
608  .WithMany()
609  .HasForeignKey("CompileJobId");
610  });
611 
612  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
613  {
614  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
615  .WithOne("RepositorySettings")
616  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
617  .OnDelete(DeleteBehavior.Cascade);
618  });
619 
620  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
621  {
622  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
623  .WithMany("ActiveTestMerges")
624  .HasForeignKey("RevisionInformationId")
625  .OnDelete(DeleteBehavior.Cascade);
626 
627  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
628  .WithMany("RevisonInformations")
629  .HasForeignKey("TestMergeId")
630  .OnDelete(DeleteBehavior.Cascade);
631  });
632 
633  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
634  {
635  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
636  .WithMany("RevisionInformations")
637  .HasForeignKey("InstanceId")
638  .OnDelete(DeleteBehavior.Cascade);
639  });
640 
641  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
642  {
643  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
644  .WithMany("TestMerges")
645  .HasForeignKey("MergedById")
646  .OnDelete(DeleteBehavior.Restrict);
647 
648  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
649  .WithOne("PrimaryTestMerge")
650  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
651  .OnDelete(DeleteBehavior.Restrict);
652  });
653 
654  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
655  {
656  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
657  .WithMany("CreatedUsers")
658  .HasForeignKey("CreatedById");
659  });
660 
661  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
662  {
663  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
664  .WithMany()
665  .HasForeignKey("AlphaId");
666 
667  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
668  .WithMany()
669  .HasForeignKey("BravoId");
670 
671  b.HasOne("Tgstation.Server.Host.Models.Instance")
672  .WithOne("WatchdogReattachInformation")
673  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
674  .OnDelete(DeleteBehavior.Cascade);
675  });
676 #pragma warning restore 612, 618
677  }
678  }
679 }
- - -
DatabaseContext<TParentContext> for Sqlserver
- - - + +
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MSNullableAndForeignKeyCleanup
 Cleans up of nullable columns and foreign keys MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MSNullableAndForeignKeyCleanup
 Cleans up of nullable columns and foreign keys MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180918205224___m_s_nullable_and_foreign_key_cleanup_8cs_source.html b/20180918205224___m_s_nullable_and_foreign_key_cleanup_8cs_source.html index 26d2e4ab42..a1619619b8 100644 --- a/20180918205224___m_s_nullable_and_foreign_key_cleanup_8cs_source.html +++ b/20180918205224___m_s_nullable_and_foreign_key_cleanup_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180918205224_MSNullableAndForeignKeyCleanup.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180918205224_MSNullableAndForeignKeyCleanup.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,11 +71,11 @@ $(function() {
20180918205224_MSNullableAndForeignKeyCleanup.cs
-Go to the documentation of this file.
1 using System;
2 using Microsoft.EntityFrameworkCore.Migrations;
3 
5 {
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropForeignKey(
21  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInformationId",
22  table: "Instances");
23 
24  migrationBuilder.DropForeignKey(
25  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
26  table: "TestMerges");
27 
28  migrationBuilder.DropIndex(
29  name: "IX_TestMerges_PrimaryRevisionInformationId",
30  table: "TestMerges");
31 
32  migrationBuilder.DropIndex(
33  name: "IX_Instances_WatchdogReattachInformationId",
34  table: "Instances");
35 
36  migrationBuilder.DropIndex(
37  name: "IX_CompileJobs_JobId",
38  table: "CompileJobs");
39 
40  migrationBuilder.DropColumn(
41  name: "WatchdogReattachInformationId",
42  table: "Instances");
43 
44  migrationBuilder.AddColumn<long>(
45  name: "InstanceId",
46  table: "WatchdogReattachInformations",
47  nullable: false,
48  defaultValue: 0L);
49 
50  migrationBuilder.AlterColumn<long>(
51  name: "PrimaryRevisionInformationId",
52  table: "TestMerges",
53  nullable: false,
54  oldClrType: typeof(long),
55  oldNullable: true);
56 
57  migrationBuilder.AlterColumn<string>(
58  name: "Output",
59  table: "CompileJobs",
60  nullable: false,
61  oldClrType: typeof(string),
62  oldNullable: true);
63 
64  migrationBuilder.AlterColumn<long>(
65  name: "JobId",
66  table: "CompileJobs",
67  nullable: false,
68  oldClrType: typeof(long),
69  oldNullable: true);
70 
71  migrationBuilder.AlterColumn<string>(
72  name: "DmeName",
73  table: "CompileJobs",
74  nullable: false,
75  oldClrType: typeof(string),
76  oldNullable: true);
77 
78  migrationBuilder.AlterColumn<Guid>(
79  name: "DirectoryName",
80  table: "CompileJobs",
81  nullable: false,
82  oldClrType: typeof(Guid),
83  oldNullable: true);
84 
85  migrationBuilder.CreateIndex(
86  name: "IX_WatchdogReattachInformations_InstanceId",
87  table: "WatchdogReattachInformations",
88  column: "InstanceId",
89  unique: true);
90 
91  migrationBuilder.CreateIndex(
92  name: "IX_TestMerges_PrimaryRevisionInformationId",
93  table: "TestMerges",
94  column: "PrimaryRevisionInformationId",
95  unique: true);
96 
97  migrationBuilder.CreateIndex(
98  name: "IX_CompileJobs_JobId",
99  table: "CompileJobs",
100  column: "JobId",
101  unique: true);
102 
103  migrationBuilder.AddForeignKey(
104  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
105  table: "TestMerges",
106  column: "PrimaryRevisionInformationId",
107  principalTable: "RevisionInformations",
108  principalColumn: "Id",
109  onDelete: ReferentialAction.Restrict);
110 
111  migrationBuilder.AddForeignKey(
112  name: "FK_WatchdogReattachInformations_Instances_InstanceId",
113  table: "WatchdogReattachInformations",
114  column: "InstanceId",
115  principalTable: "Instances",
116  principalColumn: "Id",
117  onDelete: ReferentialAction.Cascade);
118  }
119 
124  protected override void Down(MigrationBuilder migrationBuilder)
125  {
126  if (migrationBuilder == null)
127  throw new ArgumentNullException(nameof(migrationBuilder));
128 
129  migrationBuilder.DropForeignKey(
130  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
131  table: "TestMerges");
132 
133  migrationBuilder.DropForeignKey(
134  name: "FK_WatchdogReattachInformations_Instances_InstanceId",
135  table: "WatchdogReattachInformations");
136 
137  migrationBuilder.DropIndex(
138  name: "IX_WatchdogReattachInformations_InstanceId",
139  table: "WatchdogReattachInformations");
140 
141  migrationBuilder.DropIndex(
142  name: "IX_TestMerges_PrimaryRevisionInformationId",
143  table: "TestMerges");
144 
145  migrationBuilder.DropIndex(
146  name: "IX_CompileJobs_JobId",
147  table: "CompileJobs");
148 
149  migrationBuilder.DropColumn(
150  name: "InstanceId",
151  table: "WatchdogReattachInformations");
152 
153  migrationBuilder.AlterColumn<long>(
154  name: "PrimaryRevisionInformationId",
155  table: "TestMerges",
156  nullable: true,
157  oldClrType: typeof(long));
158 
159  migrationBuilder.AddColumn<long>(
160  name: "WatchdogReattachInformationId",
161  table: "Instances",
162  nullable: true);
163 
164  migrationBuilder.AlterColumn<string>(
165  name: "Output",
166  table: "CompileJobs",
167  nullable: true,
168  oldClrType: typeof(string));
169 
170  migrationBuilder.AlterColumn<long>(
171  name: "JobId",
172  table: "CompileJobs",
173  nullable: true,
174  oldClrType: typeof(long));
175 
176  migrationBuilder.AlterColumn<string>(
177  name: "DmeName",
178  table: "CompileJobs",
179  nullable: true,
180  oldClrType: typeof(string));
181 
182  migrationBuilder.AlterColumn<Guid>(
183  name: "DirectoryName",
184  table: "CompileJobs",
185  nullable: true,
186  oldClrType: typeof(Guid));
187 
188  migrationBuilder.CreateIndex(
189  name: "IX_TestMerges_PrimaryRevisionInformationId",
190  table: "TestMerges",
191  column: "PrimaryRevisionInformationId",
192  unique: true,
193  filter: "[PrimaryRevisionInformationId] IS NOT NULL");
194 
195  migrationBuilder.CreateIndex(
196  name: "IX_Instances_WatchdogReattachInformationId",
197  table: "Instances",
198  column: "WatchdogReattachInformationId");
199 
200  migrationBuilder.CreateIndex(
201  name: "IX_CompileJobs_JobId",
202  table: "CompileJobs",
203  column: "JobId");
204 
205  migrationBuilder.AddForeignKey(
206  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInformationId",
207  table: "Instances",
208  column: "WatchdogReattachInformationId",
209  principalTable: "WatchdogReattachInformations",
210  principalColumn: "Id",
211  onDelete: ReferentialAction.Restrict);
212 
213  migrationBuilder.AddForeignKey(
214  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
215  table: "TestMerges",
216  column: "PrimaryRevisionInformationId",
217  principalTable: "RevisionInformations",
218  principalColumn: "Id",
219  onDelete: ReferentialAction.SetNull);
220  }
221  }
222 }
-
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
-
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
+Go to the documentation of this file.
1 using System;
2 using Microsoft.EntityFrameworkCore.Migrations;
3 
5 {
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropForeignKey(
21  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInformationId",
22  table: "Instances");
23 
24  migrationBuilder.DropForeignKey(
25  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
26  table: "TestMerges");
27 
28  migrationBuilder.DropIndex(
29  name: "IX_TestMerges_PrimaryRevisionInformationId",
30  table: "TestMerges");
31 
32  migrationBuilder.DropIndex(
33  name: "IX_Instances_WatchdogReattachInformationId",
34  table: "Instances");
35 
36  migrationBuilder.DropIndex(
37  name: "IX_CompileJobs_JobId",
38  table: "CompileJobs");
39 
40  migrationBuilder.DropColumn(
41  name: "WatchdogReattachInformationId",
42  table: "Instances");
43 
44  migrationBuilder.AddColumn<long>(
45  name: "InstanceId",
46  table: "WatchdogReattachInformations",
47  nullable: false,
48  defaultValue: 0L);
49 
50  migrationBuilder.AlterColumn<long>(
51  name: "PrimaryRevisionInformationId",
52  table: "TestMerges",
53  nullable: false,
54  oldClrType: typeof(long),
55  oldNullable: true);
56 
57  migrationBuilder.AlterColumn<string>(
58  name: "Output",
59  table: "CompileJobs",
60  nullable: false,
61  oldClrType: typeof(string),
62  oldNullable: true);
63 
64  migrationBuilder.AlterColumn<long>(
65  name: "JobId",
66  table: "CompileJobs",
67  nullable: false,
68  oldClrType: typeof(long),
69  oldNullable: true);
70 
71  migrationBuilder.AlterColumn<string>(
72  name: "DmeName",
73  table: "CompileJobs",
74  nullable: false,
75  oldClrType: typeof(string),
76  oldNullable: true);
77 
78  migrationBuilder.AlterColumn<Guid>(
79  name: "DirectoryName",
80  table: "CompileJobs",
81  nullable: false,
82  oldClrType: typeof(Guid),
83  oldNullable: true);
84 
85  migrationBuilder.CreateIndex(
86  name: "IX_WatchdogReattachInformations_InstanceId",
87  table: "WatchdogReattachInformations",
88  column: "InstanceId",
89  unique: true);
90 
91  migrationBuilder.CreateIndex(
92  name: "IX_TestMerges_PrimaryRevisionInformationId",
93  table: "TestMerges",
94  column: "PrimaryRevisionInformationId",
95  unique: true);
96 
97  migrationBuilder.CreateIndex(
98  name: "IX_CompileJobs_JobId",
99  table: "CompileJobs",
100  column: "JobId",
101  unique: true);
102 
103  migrationBuilder.AddForeignKey(
104  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
105  table: "TestMerges",
106  column: "PrimaryRevisionInformationId",
107  principalTable: "RevisionInformations",
108  principalColumn: "Id",
109  onDelete: ReferentialAction.Restrict);
110 
111  migrationBuilder.AddForeignKey(
112  name: "FK_WatchdogReattachInformations_Instances_InstanceId",
113  table: "WatchdogReattachInformations",
114  column: "InstanceId",
115  principalTable: "Instances",
116  principalColumn: "Id",
117  onDelete: ReferentialAction.Cascade);
118  }
119 
124  protected override void Down(MigrationBuilder migrationBuilder)
125  {
126  if (migrationBuilder == null)
127  throw new ArgumentNullException(nameof(migrationBuilder));
128 
129  migrationBuilder.DropForeignKey(
130  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
131  table: "TestMerges");
132 
133  migrationBuilder.DropForeignKey(
134  name: "FK_WatchdogReattachInformations_Instances_InstanceId",
135  table: "WatchdogReattachInformations");
136 
137  migrationBuilder.DropIndex(
138  name: "IX_WatchdogReattachInformations_InstanceId",
139  table: "WatchdogReattachInformations");
140 
141  migrationBuilder.DropIndex(
142  name: "IX_TestMerges_PrimaryRevisionInformationId",
143  table: "TestMerges");
144 
145  migrationBuilder.DropIndex(
146  name: "IX_CompileJobs_JobId",
147  table: "CompileJobs");
148 
149  migrationBuilder.DropColumn(
150  name: "InstanceId",
151  table: "WatchdogReattachInformations");
152 
153  migrationBuilder.AlterColumn<long>(
154  name: "PrimaryRevisionInformationId",
155  table: "TestMerges",
156  nullable: true,
157  oldClrType: typeof(long));
158 
159  migrationBuilder.AddColumn<long>(
160  name: "WatchdogReattachInformationId",
161  table: "Instances",
162  nullable: true);
163 
164  migrationBuilder.AlterColumn<string>(
165  name: "Output",
166  table: "CompileJobs",
167  nullable: true,
168  oldClrType: typeof(string));
169 
170  migrationBuilder.AlterColumn<long>(
171  name: "JobId",
172  table: "CompileJobs",
173  nullable: true,
174  oldClrType: typeof(long));
175 
176  migrationBuilder.AlterColumn<string>(
177  name: "DmeName",
178  table: "CompileJobs",
179  nullable: true,
180  oldClrType: typeof(string));
181 
182  migrationBuilder.AlterColumn<Guid>(
183  name: "DirectoryName",
184  table: "CompileJobs",
185  nullable: true,
186  oldClrType: typeof(Guid));
187 
188  migrationBuilder.CreateIndex(
189  name: "IX_TestMerges_PrimaryRevisionInformationId",
190  table: "TestMerges",
191  column: "PrimaryRevisionInformationId",
192  unique: true,
193  filter: "[PrimaryRevisionInformationId] IS NOT NULL");
194 
195  migrationBuilder.CreateIndex(
196  name: "IX_Instances_WatchdogReattachInformationId",
197  table: "Instances",
198  column: "WatchdogReattachInformationId");
199 
200  migrationBuilder.CreateIndex(
201  name: "IX_CompileJobs_JobId",
202  table: "CompileJobs",
203  column: "JobId");
204 
205  migrationBuilder.AddForeignKey(
206  name: "FK_Instances_WatchdogReattachInformations_WatchdogReattachInformationId",
207  table: "Instances",
208  column: "WatchdogReattachInformationId",
209  principalTable: "WatchdogReattachInformations",
210  principalColumn: "Id",
211  onDelete: ReferentialAction.Restrict);
212 
213  migrationBuilder.AddForeignKey(
214  name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId",
215  table: "TestMerges",
216  column: "PrimaryRevisionInformationId",
217  principalTable: "RevisionInformations",
218  principalColumn: "Id",
219  onDelete: ReferentialAction.SetNull);
220  }
221  }
222 }
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
- + + +
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MSReattachCompileJobRequired
 Marks the CompileJobs of ReattachInformations as non-nullable for MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MSReattachCompileJobRequired
 Marks the Models.CompileJobs of Models.ReattachInformations as non-nullable for MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180926033145___m_s_reattach_compile_job_required_8_designer_8cs_source.html b/20180926033145___m_s_reattach_compile_job_required_8_designer_8cs_source.html index 4633582dab..7502c9541a 100644 --- a/20180926033145___m_s_reattach_compile_job_required_8_designer_8cs_source.html +++ b/20180926033145___m_s_reattach_compile_job_required_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180926033145_MSReattachCompileJobRequired.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180926033145_MSReattachCompileJobRequired.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20180926033145_MSReattachCompileJobRequired.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
9 
11 {
13  [Migration("20180926033145_MSReattachCompileJobRequired")]
14  partial class MSReattachCompileJobRequired
15  {
20  protected override void BuildTargetModel(ModelBuilder modelBuilder)
21  {
22 #pragma warning disable 612, 618
23  modelBuilder
24  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
25  .HasAnnotation("Relational:MaxIdentifierLength", 128)
26  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
27 
28  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
29  {
30  b.Property<long>("Id")
31  .ValueGeneratedOnAdd()
32  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
33 
34  b.Property<string>("ConnectionString")
35  .IsRequired();
36 
37  b.Property<bool?>("Enabled");
38 
39  b.Property<long>("InstanceId");
40 
41  b.Property<string>("Name")
42  .IsRequired();
43 
44  b.Property<int?>("Provider");
45 
46  b.HasKey("Id");
47 
48  b.HasIndex("InstanceId");
49 
50  b.HasIndex("Name")
51  .IsUnique();
52 
53  b.ToTable("ChatBots");
54  });
55 
56  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
57  {
58  b.Property<long>("Id")
59  .ValueGeneratedOnAdd()
60  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
61 
62  b.Property<long>("ChatSettingsId");
63 
64  b.Property<decimal?>("DiscordChannelId")
65  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
66 
67  b.Property<string>("IrcChannel");
68 
69  b.Property<bool?>("IsAdminChannel")
70  .IsRequired();
71 
72  b.Property<bool?>("IsUpdatesChannel")
73  .IsRequired();
74 
75  b.Property<bool?>("IsWatchdogChannel")
76  .IsRequired();
77 
78  b.Property<string>("Tag");
79 
80  b.HasKey("Id");
81 
82  b.HasIndex("ChatSettingsId", "DiscordChannelId")
83  .IsUnique()
84  .HasFilter("[DiscordChannelId] IS NOT NULL");
85 
86  b.HasIndex("ChatSettingsId", "IrcChannel")
87  .IsUnique()
88  .HasFilter("[IrcChannel] IS NOT NULL");
89 
90  b.ToTable("ChatChannels");
91  });
92 
93  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
94  {
95  b.Property<long>("Id")
96  .ValueGeneratedOnAdd()
97  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
98 
99  b.Property<string>("ByondVersion")
100  .IsRequired();
101 
102  b.Property<Guid?>("DirectoryName")
103  .IsRequired();
104 
105  b.Property<string>("DmeName")
106  .IsRequired();
107 
108  b.Property<long>("JobId");
109 
110  b.Property<int>("MinimumSecurityLevel");
111 
112  b.Property<string>("Output")
113  .IsRequired();
114 
115  b.Property<long>("RevisionInformationId");
116 
117  b.HasKey("Id");
118 
119  b.HasIndex("DirectoryName");
120 
121  b.HasIndex("JobId")
122  .IsUnique();
123 
124  b.HasIndex("RevisionInformationId");
125 
126  b.ToTable("CompileJobs");
127  });
128 
129  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
130  {
131  b.Property<long>("Id")
132  .ValueGeneratedOnAdd()
133  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
134 
135  b.Property<string>("AccessToken");
136 
137  b.Property<bool?>("AllowWebClient")
138  .IsRequired();
139 
140  b.Property<bool?>("AutoStart")
141  .IsRequired();
142 
143  b.Property<long>("InstanceId");
144 
145  b.Property<int>("PrimaryPort");
146 
147  b.Property<int?>("ProcessId");
148 
149  b.Property<int>("SecondaryPort");
150 
151  b.Property<int>("SecurityLevel");
152 
153  b.Property<bool?>("SoftRestart")
154  .IsRequired();
155 
156  b.Property<bool?>("SoftShutdown")
157  .IsRequired();
158 
159  b.Property<long>("StartupTimeout");
160 
161  b.HasKey("Id");
162 
163  b.HasIndex("InstanceId")
164  .IsUnique();
165 
166  b.ToTable("DreamDaemonSettings");
167  });
168 
169  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
170  {
171  b.Property<long>("Id")
172  .ValueGeneratedOnAdd()
173  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
174 
175  b.Property<int>("ApiValidationPort");
176 
177  b.Property<int>("ApiValidationSecurityLevel");
178 
179  b.Property<long>("InstanceId");
180 
181  b.Property<string>("ProjectName");
182 
183  b.HasKey("Id");
184 
185  b.HasIndex("InstanceId")
186  .IsUnique();
187 
188  b.ToTable("DreamMakerSettings");
189  });
190 
191  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
192  {
193  b.Property<long>("Id")
194  .ValueGeneratedOnAdd()
195  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
196 
197  b.Property<long>("AutoUpdateInterval");
198 
199  b.Property<int>("ConfigurationType");
200 
201  b.Property<string>("Name")
202  .IsRequired();
203 
204  b.Property<bool?>("Online")
205  .IsRequired();
206 
207  b.Property<string>("Path")
208  .IsRequired();
209 
210  b.HasKey("Id");
211 
212  b.HasIndex("Path")
213  .IsUnique();
214 
215  b.ToTable("Instances");
216  });
217 
218  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
219  {
220  b.Property<long>("Id")
221  .ValueGeneratedOnAdd()
222  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
223 
224  b.Property<decimal>("ByondRights")
225  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
226 
227  b.Property<decimal>("ChatBotRights")
228  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
229 
230  b.Property<decimal>("ConfigurationRights")
231  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
232 
233  b.Property<decimal>("DreamDaemonRights")
234  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
235 
236  b.Property<decimal>("DreamMakerRights")
237  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
238 
239  b.Property<long>("InstanceId");
240 
241  b.Property<decimal>("InstanceUserRights")
242  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
243 
244  b.Property<decimal>("RepositoryRights")
245  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
246 
247  b.Property<long?>("UserId")
248  .IsRequired();
249 
250  b.HasKey("Id");
251 
252  b.HasIndex("InstanceId");
253 
254  b.HasIndex("UserId", "InstanceId")
255  .IsUnique();
256 
257  b.ToTable("InstanceUsers");
258  });
259 
260  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
261  {
262  b.Property<long>("Id")
263  .ValueGeneratedOnAdd()
264  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
265 
266  b.Property<decimal?>("CancelRight")
267  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
268 
269  b.Property<decimal?>("CancelRightsType")
270  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
271 
272  b.Property<bool?>("Cancelled")
273  .IsRequired();
274 
275  b.Property<long?>("CancelledById");
276 
277  b.Property<string>("Description")
278  .IsRequired();
279 
280  b.Property<string>("ExceptionDetails");
281 
282  b.Property<long>("InstanceId");
283 
284  b.Property<DateTimeOffset?>("StartedAt")
285  .IsRequired();
286 
287  b.Property<long>("StartedById");
288 
289  b.Property<DateTimeOffset?>("StoppedAt");
290 
291  b.HasKey("Id");
292 
293  b.HasIndex("CancelledById");
294 
295  b.HasIndex("InstanceId");
296 
297  b.HasIndex("StartedById");
298 
299  b.ToTable("Jobs");
300  });
301 
302  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
303  {
304  b.Property<long>("Id")
305  .ValueGeneratedOnAdd()
306  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
307 
308  b.Property<string>("AccessIdentifier")
309  .IsRequired();
310 
311  b.Property<string>("ChatChannelsJson")
312  .IsRequired();
313 
314  b.Property<string>("ChatCommandsJson")
315  .IsRequired();
316 
317  b.Property<long>("CompileJobId");
318 
319  b.Property<bool>("IsPrimary");
320 
321  b.Property<int>("Port");
322 
323  b.Property<int>("ProcessId");
324 
325  b.Property<int>("RebootState");
326 
327  b.Property<string>("ServerCommandsJson")
328  .IsRequired();
329 
330  b.HasKey("Id");
331 
332  b.HasIndex("CompileJobId");
333 
334  b.ToTable("ReattachInformations");
335  });
336 
337  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
338  {
339  b.Property<long>("Id")
340  .ValueGeneratedOnAdd()
341  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
342 
343  b.Property<string>("AccessToken");
344 
345  b.Property<string>("AccessUser");
346 
347  b.Property<bool?>("AutoUpdatesKeepTestMerges")
348  .IsRequired();
349 
350  b.Property<bool?>("AutoUpdatesSynchronize")
351  .IsRequired();
352 
353  b.Property<string>("CommitterEmail")
354  .IsRequired();
355 
356  b.Property<string>("CommitterName")
357  .IsRequired();
358 
359  b.Property<long>("InstanceId");
360 
361  b.Property<bool?>("PushTestMergeCommits")
362  .IsRequired();
363 
364  b.Property<bool?>("ShowTestMergeCommitters")
365  .IsRequired();
366 
367  b.HasKey("Id");
368 
369  b.HasIndex("InstanceId")
370  .IsUnique();
371 
372  b.ToTable("RepositorySettings");
373  });
374 
375  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
376  {
377  b.Property<long>("Id")
378  .ValueGeneratedOnAdd()
379  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
380 
381  b.Property<long>("RevisionInformationId");
382 
383  b.Property<long>("TestMergeId");
384 
385  b.HasKey("Id");
386 
387  b.HasIndex("RevisionInformationId");
388 
389  b.HasIndex("TestMergeId");
390 
391  b.ToTable("RevInfoTestMerges");
392  });
393 
394  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
395  {
396  b.Property<long>("Id")
397  .ValueGeneratedOnAdd()
398  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
399 
400  b.Property<string>("CommitSha")
401  .IsRequired()
402  .HasMaxLength(40);
403 
404  b.Property<long>("InstanceId");
405 
406  b.Property<string>("OriginCommitSha")
407  .IsRequired()
408  .HasMaxLength(40);
409 
410  b.HasKey("Id");
411 
412  b.HasIndex("CommitSha")
413  .IsUnique();
414 
415  b.HasIndex("InstanceId");
416 
417  b.ToTable("RevisionInformations");
418  });
419 
420  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
421  {
422  b.Property<long>("Id")
423  .ValueGeneratedOnAdd()
424  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
425 
426  b.Property<string>("Author")
427  .IsRequired();
428 
429  b.Property<string>("BodyAtMerge")
430  .IsRequired();
431 
432  b.Property<string>("Comment");
433 
434  b.Property<DateTimeOffset>("MergedAt");
435 
436  b.Property<long>("MergedById");
437 
438  b.Property<int?>("Number")
439  .IsRequired();
440 
441  b.Property<long?>("PrimaryRevisionInformationId")
442  .IsRequired();
443 
444  b.Property<string>("PullRequestRevision")
445  .IsRequired();
446 
447  b.Property<string>("TitleAtMerge")
448  .IsRequired();
449 
450  b.Property<string>("Url")
451  .IsRequired();
452 
453  b.HasKey("Id");
454 
455  b.HasIndex("MergedById");
456 
457  b.HasIndex("PrimaryRevisionInformationId")
458  .IsUnique();
459 
460  b.ToTable("TestMerges");
461  });
462 
463  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
464  {
465  b.Property<long>("Id")
466  .ValueGeneratedOnAdd()
467  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
468 
469  b.Property<decimal>("AdministrationRights")
470  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
471 
472  b.Property<string>("CanonicalName")
473  .IsRequired();
474 
475  b.Property<DateTimeOffset?>("CreatedAt")
476  .IsRequired();
477 
478  b.Property<long?>("CreatedById");
479 
480  b.Property<bool?>("Enabled")
481  .IsRequired();
482 
483  b.Property<decimal>("InstanceManagerRights")
484  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
485 
486  b.Property<DateTimeOffset?>("LastPasswordUpdate");
487 
488  b.Property<string>("Name")
489  .IsRequired();
490 
491  b.Property<string>("PasswordHash");
492 
493  b.Property<string>("SystemIdentifier");
494 
495  b.HasKey("Id");
496 
497  b.HasIndex("CanonicalName")
498  .IsUnique();
499 
500  b.HasIndex("CreatedById");
501 
502  b.ToTable("Users");
503  });
504 
505  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
506  {
507  b.Property<long>("Id")
508  .ValueGeneratedOnAdd()
509  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
510 
511  b.Property<long?>("AlphaId");
512 
513  b.Property<bool>("AlphaIsActive");
514 
515  b.Property<long?>("BravoId");
516 
517  b.Property<long>("InstanceId");
518 
519  b.HasKey("Id");
520 
521  b.HasIndex("AlphaId");
522 
523  b.HasIndex("BravoId");
524 
525  b.HasIndex("InstanceId")
526  .IsUnique();
527 
528  b.ToTable("WatchdogReattachInformations");
529  });
530 
531  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
532  {
533  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
534  .WithMany("ChatSettings")
535  .HasForeignKey("InstanceId")
536  .OnDelete(DeleteBehavior.Cascade);
537  });
538 
539  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
540  {
541  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
542  .WithMany("Channels")
543  .HasForeignKey("ChatSettingsId")
544  .OnDelete(DeleteBehavior.Cascade);
545  });
546 
547  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
548  {
549  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
550  .WithOne()
551  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
552  .OnDelete(DeleteBehavior.Restrict);
553 
554  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
555  .WithMany("CompileJobs")
556  .HasForeignKey("RevisionInformationId")
557  .OnDelete(DeleteBehavior.Cascade);
558  });
559 
560  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
561  {
562  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
563  .WithOne("DreamDaemonSettings")
564  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
565  .OnDelete(DeleteBehavior.Cascade);
566  });
567 
568  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
569  {
570  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
571  .WithOne("DreamMakerSettings")
572  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
573  .OnDelete(DeleteBehavior.Cascade);
574  });
575 
576  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
577  {
578  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
579  .WithMany("InstanceUsers")
580  .HasForeignKey("InstanceId")
581  .OnDelete(DeleteBehavior.Cascade);
582 
583  b.HasOne("Tgstation.Server.Host.Models.User")
584  .WithMany("InstanceUsers")
585  .HasForeignKey("UserId")
586  .OnDelete(DeleteBehavior.Cascade);
587  });
588 
589  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
590  {
591  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
592  .WithMany()
593  .HasForeignKey("CancelledById");
594 
595  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
596  .WithMany("Jobs")
597  .HasForeignKey("InstanceId")
598  .OnDelete(DeleteBehavior.Cascade);
599 
600  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
601  .WithMany()
602  .HasForeignKey("StartedById")
603  .OnDelete(DeleteBehavior.Cascade);
604  });
605 
606  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
607  {
608  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
609  .WithMany()
610  .HasForeignKey("CompileJobId")
611  .OnDelete(DeleteBehavior.Cascade);
612  });
613 
614  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
615  {
616  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
617  .WithOne("RepositorySettings")
618  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
619  .OnDelete(DeleteBehavior.Cascade);
620  });
621 
622  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
623  {
624  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
625  .WithMany("ActiveTestMerges")
626  .HasForeignKey("RevisionInformationId")
627  .OnDelete(DeleteBehavior.Cascade);
628 
629  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
630  .WithMany("RevisonInformations")
631  .HasForeignKey("TestMergeId")
632  .OnDelete(DeleteBehavior.Cascade);
633  });
634 
635  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
636  {
637  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
638  .WithMany("RevisionInformations")
639  .HasForeignKey("InstanceId")
640  .OnDelete(DeleteBehavior.Cascade);
641  });
642 
643  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
644  {
645  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
646  .WithMany("TestMerges")
647  .HasForeignKey("MergedById")
648  .OnDelete(DeleteBehavior.Restrict);
649 
650  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
651  .WithOne("PrimaryTestMerge")
652  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
653  .OnDelete(DeleteBehavior.Restrict);
654  });
655 
656  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
657  {
658  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
659  .WithMany("CreatedUsers")
660  .HasForeignKey("CreatedById");
661  });
662 
663  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
664  {
665  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
666  .WithMany()
667  .HasForeignKey("AlphaId");
668 
669  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
670  .WithMany()
671  .HasForeignKey("BravoId");
672 
673  b.HasOne("Tgstation.Server.Host.Models.Instance")
674  .WithOne("WatchdogReattachInformation")
675  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
676  .OnDelete(DeleteBehavior.Cascade);
677  });
678 #pragma warning restore 612, 618
679  }
680  }
681 }
- - +Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
8 
10 {
11  [DbContext(typeof(SqlServerDatabaseContext))]
12  [Migration("20180926033145_MSReattachCompileJobRequired")]
13  partial class MSReattachCompileJobRequired
14  {
19  protected override void BuildTargetModel(ModelBuilder modelBuilder)
20  {
21 #pragma warning disable 612, 618
22  modelBuilder
23  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
24  .HasAnnotation("Relational:MaxIdentifierLength", 128)
25  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
26 
27  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
28  {
29  b.Property<long>("Id")
30  .ValueGeneratedOnAdd()
31  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
32 
33  b.Property<string>("ConnectionString")
34  .IsRequired();
35 
36  b.Property<bool?>("Enabled");
37 
38  b.Property<long>("InstanceId");
39 
40  b.Property<string>("Name")
41  .IsRequired();
42 
43  b.Property<int?>("Provider");
44 
45  b.HasKey("Id");
46 
47  b.HasIndex("InstanceId");
48 
49  b.HasIndex("Name")
50  .IsUnique();
51 
52  b.ToTable("ChatBots");
53  });
54 
55  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
56  {
57  b.Property<long>("Id")
58  .ValueGeneratedOnAdd()
59  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
60 
61  b.Property<long>("ChatSettingsId");
62 
63  b.Property<decimal?>("DiscordChannelId")
64  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
65 
66  b.Property<string>("IrcChannel");
67 
68  b.Property<bool?>("IsAdminChannel")
69  .IsRequired();
70 
71  b.Property<bool?>("IsUpdatesChannel")
72  .IsRequired();
73 
74  b.Property<bool?>("IsWatchdogChannel")
75  .IsRequired();
76 
77  b.Property<string>("Tag");
78 
79  b.HasKey("Id");
80 
81  b.HasIndex("ChatSettingsId", "DiscordChannelId")
82  .IsUnique()
83  .HasFilter("[DiscordChannelId] IS NOT NULL");
84 
85  b.HasIndex("ChatSettingsId", "IrcChannel")
86  .IsUnique()
87  .HasFilter("[IrcChannel] IS NOT NULL");
88 
89  b.ToTable("ChatChannels");
90  });
91 
92  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
93  {
94  b.Property<long>("Id")
95  .ValueGeneratedOnAdd()
96  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
97 
98  b.Property<string>("ByondVersion")
99  .IsRequired();
100 
101  b.Property<Guid?>("DirectoryName")
102  .IsRequired();
103 
104  b.Property<string>("DmeName")
105  .IsRequired();
106 
107  b.Property<long>("JobId");
108 
109  b.Property<int>("MinimumSecurityLevel");
110 
111  b.Property<string>("Output")
112  .IsRequired();
113 
114  b.Property<long>("RevisionInformationId");
115 
116  b.HasKey("Id");
117 
118  b.HasIndex("DirectoryName");
119 
120  b.HasIndex("JobId")
121  .IsUnique();
122 
123  b.HasIndex("RevisionInformationId");
124 
125  b.ToTable("CompileJobs");
126  });
127 
128  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
129  {
130  b.Property<long>("Id")
131  .ValueGeneratedOnAdd()
132  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
133 
134  b.Property<string>("AccessToken");
135 
136  b.Property<bool?>("AllowWebClient")
137  .IsRequired();
138 
139  b.Property<bool?>("AutoStart")
140  .IsRequired();
141 
142  b.Property<long>("InstanceId");
143 
144  b.Property<int>("PrimaryPort");
145 
146  b.Property<int?>("ProcessId");
147 
148  b.Property<int>("SecondaryPort");
149 
150  b.Property<int>("SecurityLevel");
151 
152  b.Property<bool?>("SoftRestart")
153  .IsRequired();
154 
155  b.Property<bool?>("SoftShutdown")
156  .IsRequired();
157 
158  b.Property<long>("StartupTimeout");
159 
160  b.HasKey("Id");
161 
162  b.HasIndex("InstanceId")
163  .IsUnique();
164 
165  b.ToTable("DreamDaemonSettings");
166  });
167 
168  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
169  {
170  b.Property<long>("Id")
171  .ValueGeneratedOnAdd()
172  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
173 
174  b.Property<int>("ApiValidationPort");
175 
176  b.Property<int>("ApiValidationSecurityLevel");
177 
178  b.Property<long>("InstanceId");
179 
180  b.Property<string>("ProjectName");
181 
182  b.HasKey("Id");
183 
184  b.HasIndex("InstanceId")
185  .IsUnique();
186 
187  b.ToTable("DreamMakerSettings");
188  });
189 
190  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
191  {
192  b.Property<long>("Id")
193  .ValueGeneratedOnAdd()
194  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
195 
196  b.Property<long>("AutoUpdateInterval");
197 
198  b.Property<int>("ConfigurationType");
199 
200  b.Property<string>("Name")
201  .IsRequired();
202 
203  b.Property<bool?>("Online")
204  .IsRequired();
205 
206  b.Property<string>("Path")
207  .IsRequired();
208 
209  b.HasKey("Id");
210 
211  b.HasIndex("Path")
212  .IsUnique();
213 
214  b.ToTable("Instances");
215  });
216 
217  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
218  {
219  b.Property<long>("Id")
220  .ValueGeneratedOnAdd()
221  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
222 
223  b.Property<decimal>("ByondRights")
224  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
225 
226  b.Property<decimal>("ChatBotRights")
227  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
228 
229  b.Property<decimal>("ConfigurationRights")
230  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
231 
232  b.Property<decimal>("DreamDaemonRights")
233  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
234 
235  b.Property<decimal>("DreamMakerRights")
236  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
237 
238  b.Property<long>("InstanceId");
239 
240  b.Property<decimal>("InstanceUserRights")
241  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
242 
243  b.Property<decimal>("RepositoryRights")
244  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
245 
246  b.Property<long?>("UserId")
247  .IsRequired();
248 
249  b.HasKey("Id");
250 
251  b.HasIndex("InstanceId");
252 
253  b.HasIndex("UserId", "InstanceId")
254  .IsUnique();
255 
256  b.ToTable("InstanceUsers");
257  });
258 
259  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
260  {
261  b.Property<long>("Id")
262  .ValueGeneratedOnAdd()
263  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
264 
265  b.Property<decimal?>("CancelRight")
266  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
267 
268  b.Property<decimal?>("CancelRightsType")
269  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
270 
271  b.Property<bool?>("Cancelled")
272  .IsRequired();
273 
274  b.Property<long?>("CancelledById");
275 
276  b.Property<string>("Description")
277  .IsRequired();
278 
279  b.Property<string>("ExceptionDetails");
280 
281  b.Property<long>("InstanceId");
282 
283  b.Property<DateTimeOffset?>("StartedAt")
284  .IsRequired();
285 
286  b.Property<long>("StartedById");
287 
288  b.Property<DateTimeOffset?>("StoppedAt");
289 
290  b.HasKey("Id");
291 
292  b.HasIndex("CancelledById");
293 
294  b.HasIndex("InstanceId");
295 
296  b.HasIndex("StartedById");
297 
298  b.ToTable("Jobs");
299  });
300 
301  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
302  {
303  b.Property<long>("Id")
304  .ValueGeneratedOnAdd()
305  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
306 
307  b.Property<string>("AccessIdentifier")
308  .IsRequired();
309 
310  b.Property<string>("ChatChannelsJson")
311  .IsRequired();
312 
313  b.Property<string>("ChatCommandsJson")
314  .IsRequired();
315 
316  b.Property<long>("CompileJobId");
317 
318  b.Property<bool>("IsPrimary");
319 
320  b.Property<int>("Port");
321 
322  b.Property<int>("ProcessId");
323 
324  b.Property<int>("RebootState");
325 
326  b.Property<string>("ServerCommandsJson")
327  .IsRequired();
328 
329  b.HasKey("Id");
330 
331  b.HasIndex("CompileJobId");
332 
333  b.ToTable("ReattachInformations");
334  });
335 
336  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
337  {
338  b.Property<long>("Id")
339  .ValueGeneratedOnAdd()
340  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
341 
342  b.Property<string>("AccessToken");
343 
344  b.Property<string>("AccessUser");
345 
346  b.Property<bool?>("AutoUpdatesKeepTestMerges")
347  .IsRequired();
348 
349  b.Property<bool?>("AutoUpdatesSynchronize")
350  .IsRequired();
351 
352  b.Property<string>("CommitterEmail")
353  .IsRequired();
354 
355  b.Property<string>("CommitterName")
356  .IsRequired();
357 
358  b.Property<long>("InstanceId");
359 
360  b.Property<bool?>("PushTestMergeCommits")
361  .IsRequired();
362 
363  b.Property<bool?>("ShowTestMergeCommitters")
364  .IsRequired();
365 
366  b.HasKey("Id");
367 
368  b.HasIndex("InstanceId")
369  .IsUnique();
370 
371  b.ToTable("RepositorySettings");
372  });
373 
374  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
375  {
376  b.Property<long>("Id")
377  .ValueGeneratedOnAdd()
378  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
379 
380  b.Property<long>("RevisionInformationId");
381 
382  b.Property<long>("TestMergeId");
383 
384  b.HasKey("Id");
385 
386  b.HasIndex("RevisionInformationId");
387 
388  b.HasIndex("TestMergeId");
389 
390  b.ToTable("RevInfoTestMerges");
391  });
392 
393  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
394  {
395  b.Property<long>("Id")
396  .ValueGeneratedOnAdd()
397  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
398 
399  b.Property<string>("CommitSha")
400  .IsRequired()
401  .HasMaxLength(40);
402 
403  b.Property<long>("InstanceId");
404 
405  b.Property<string>("OriginCommitSha")
406  .IsRequired()
407  .HasMaxLength(40);
408 
409  b.HasKey("Id");
410 
411  b.HasIndex("CommitSha")
412  .IsUnique();
413 
414  b.HasIndex("InstanceId");
415 
416  b.ToTable("RevisionInformations");
417  });
418 
419  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
420  {
421  b.Property<long>("Id")
422  .ValueGeneratedOnAdd()
423  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
424 
425  b.Property<string>("Author")
426  .IsRequired();
427 
428  b.Property<string>("BodyAtMerge")
429  .IsRequired();
430 
431  b.Property<string>("Comment");
432 
433  b.Property<DateTimeOffset>("MergedAt");
434 
435  b.Property<long>("MergedById");
436 
437  b.Property<int?>("Number")
438  .IsRequired();
439 
440  b.Property<long?>("PrimaryRevisionInformationId")
441  .IsRequired();
442 
443  b.Property<string>("PullRequestRevision")
444  .IsRequired();
445 
446  b.Property<string>("TitleAtMerge")
447  .IsRequired();
448 
449  b.Property<string>("Url")
450  .IsRequired();
451 
452  b.HasKey("Id");
453 
454  b.HasIndex("MergedById");
455 
456  b.HasIndex("PrimaryRevisionInformationId")
457  .IsUnique();
458 
459  b.ToTable("TestMerges");
460  });
461 
462  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
463  {
464  b.Property<long>("Id")
465  .ValueGeneratedOnAdd()
466  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
467 
468  b.Property<decimal>("AdministrationRights")
469  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
470 
471  b.Property<string>("CanonicalName")
472  .IsRequired();
473 
474  b.Property<DateTimeOffset?>("CreatedAt")
475  .IsRequired();
476 
477  b.Property<long?>("CreatedById");
478 
479  b.Property<bool?>("Enabled")
480  .IsRequired();
481 
482  b.Property<decimal>("InstanceManagerRights")
483  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
484 
485  b.Property<DateTimeOffset?>("LastPasswordUpdate");
486 
487  b.Property<string>("Name")
488  .IsRequired();
489 
490  b.Property<string>("PasswordHash");
491 
492  b.Property<string>("SystemIdentifier");
493 
494  b.HasKey("Id");
495 
496  b.HasIndex("CanonicalName")
497  .IsUnique();
498 
499  b.HasIndex("CreatedById");
500 
501  b.ToTable("Users");
502  });
503 
504  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
505  {
506  b.Property<long>("Id")
507  .ValueGeneratedOnAdd()
508  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
509 
510  b.Property<long?>("AlphaId");
511 
512  b.Property<bool>("AlphaIsActive");
513 
514  b.Property<long?>("BravoId");
515 
516  b.Property<long>("InstanceId");
517 
518  b.HasKey("Id");
519 
520  b.HasIndex("AlphaId");
521 
522  b.HasIndex("BravoId");
523 
524  b.HasIndex("InstanceId")
525  .IsUnique();
526 
527  b.ToTable("WatchdogReattachInformations");
528  });
529 
530  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
531  {
532  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
533  .WithMany("ChatSettings")
534  .HasForeignKey("InstanceId")
535  .OnDelete(DeleteBehavior.Cascade);
536  });
537 
538  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
539  {
540  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
541  .WithMany("Channels")
542  .HasForeignKey("ChatSettingsId")
543  .OnDelete(DeleteBehavior.Cascade);
544  });
545 
546  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
547  {
548  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
549  .WithOne()
550  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
551  .OnDelete(DeleteBehavior.Restrict);
552 
553  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
554  .WithMany("CompileJobs")
555  .HasForeignKey("RevisionInformationId")
556  .OnDelete(DeleteBehavior.Cascade);
557  });
558 
559  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
560  {
561  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
562  .WithOne("DreamDaemonSettings")
563  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
564  .OnDelete(DeleteBehavior.Cascade);
565  });
566 
567  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
568  {
569  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
570  .WithOne("DreamMakerSettings")
571  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
572  .OnDelete(DeleteBehavior.Cascade);
573  });
574 
575  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
576  {
577  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
578  .WithMany("InstanceUsers")
579  .HasForeignKey("InstanceId")
580  .OnDelete(DeleteBehavior.Cascade);
581 
582  b.HasOne("Tgstation.Server.Host.Models.User")
583  .WithMany("InstanceUsers")
584  .HasForeignKey("UserId")
585  .OnDelete(DeleteBehavior.Cascade);
586  });
587 
588  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
589  {
590  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
591  .WithMany()
592  .HasForeignKey("CancelledById");
593 
594  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
595  .WithMany("Jobs")
596  .HasForeignKey("InstanceId")
597  .OnDelete(DeleteBehavior.Cascade);
598 
599  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
600  .WithMany()
601  .HasForeignKey("StartedById")
602  .OnDelete(DeleteBehavior.Cascade);
603  });
604 
605  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
606  {
607  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
608  .WithMany()
609  .HasForeignKey("CompileJobId")
610  .OnDelete(DeleteBehavior.Cascade);
611  });
612 
613  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
614  {
615  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
616  .WithOne("RepositorySettings")
617  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
618  .OnDelete(DeleteBehavior.Cascade);
619  });
620 
621  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
622  {
623  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
624  .WithMany("ActiveTestMerges")
625  .HasForeignKey("RevisionInformationId")
626  .OnDelete(DeleteBehavior.Cascade);
627 
628  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
629  .WithMany("RevisonInformations")
630  .HasForeignKey("TestMergeId")
631  .OnDelete(DeleteBehavior.Cascade);
632  });
633 
634  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
635  {
636  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
637  .WithMany("RevisionInformations")
638  .HasForeignKey("InstanceId")
639  .OnDelete(DeleteBehavior.Cascade);
640  });
641 
642  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
643  {
644  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
645  .WithMany("TestMerges")
646  .HasForeignKey("MergedById")
647  .OnDelete(DeleteBehavior.Restrict);
648 
649  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
650  .WithOne("PrimaryTestMerge")
651  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
652  .OnDelete(DeleteBehavior.Restrict);
653  });
654 
655  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
656  {
657  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
658  .WithMany("CreatedUsers")
659  .HasForeignKey("CreatedById");
660  });
661 
662  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
663  {
664  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
665  .WithMany()
666  .HasForeignKey("AlphaId");
667 
668  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
669  .WithMany()
670  .HasForeignKey("BravoId");
671 
672  b.HasOne("Tgstation.Server.Host.Models.Instance")
673  .WithOne("WatchdogReattachInformation")
674  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
675  .OnDelete(DeleteBehavior.Cascade);
676  });
677 #pragma warning restore 612, 618
678  }
679  }
680 }
- -
DatabaseContext<TParentContext> for Sqlserver
- - - + +
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MSReattachCompileJobRequired
 Marks the CompileJobs of ReattachInformations as non-nullable for MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MSReattachCompileJobRequired
 Marks the Models.CompileJobs of Models.ReattachInformations as non-nullable for MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180926033145___m_s_reattach_compile_job_required_8cs_source.html b/20180926033145___m_s_reattach_compile_job_required_8cs_source.html index ed6d460166..f6268eac24 100644 --- a/20180926033145___m_s_reattach_compile_job_required_8cs_source.html +++ b/20180926033145___m_s_reattach_compile_job_required_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180926033145_MSReattachCompileJobRequired.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180926033145_MSReattachCompileJobRequired.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,11 +71,11 @@ $(function() {
20180926033145_MSReattachCompileJobRequired.cs
-Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MSReattachCompileJobRequired : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropForeignKey(
21  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
22  table: "ReattachInformations");
23 
24  migrationBuilder.AlterColumn<long>(
25  name: "CompileJobId",
26  table: "ReattachInformations",
27  nullable: false,
28  oldClrType: typeof(long),
29  oldNullable: true);
30 
31  migrationBuilder.AddForeignKey(
32  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
33  table: "ReattachInformations",
34  column: "CompileJobId",
35  principalTable: "CompileJobs",
36  principalColumn: "Id",
37  onDelete: ReferentialAction.Cascade);
38  }
39 
44  protected override void Down(MigrationBuilder migrationBuilder)
45  {
46  if (migrationBuilder == null)
47  throw new ArgumentNullException(nameof(migrationBuilder));
48 
49  migrationBuilder.DropForeignKey(
50  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
51  table: "ReattachInformations");
52 
53  migrationBuilder.AlterColumn<long>(
54  name: "CompileJobId",
55  table: "ReattachInformations",
56  nullable: true,
57  oldClrType: typeof(long));
58 
59  migrationBuilder.AddForeignKey(
60  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
61  table: "ReattachInformations",
62  column: "CompileJobId",
63  principalTable: "CompileJobs",
64  principalColumn: "Id",
65  onDelete: ReferentialAction.Restrict);
66  }
67  }
68 }
- -
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
-
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
-
Marks the CompileJobs of ReattachInformations as non-nullable for MSSQL
+Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MSReattachCompileJobRequired : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropForeignKey(
21  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
22  table: "ReattachInformations");
23 
24  migrationBuilder.AlterColumn<long>(
25  name: "CompileJobId",
26  table: "ReattachInformations",
27  nullable: false,
28  oldClrType: typeof(long),
29  oldNullable: true);
30 
31  migrationBuilder.AddForeignKey(
32  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
33  table: "ReattachInformations",
34  column: "CompileJobId",
35  principalTable: "CompileJobs",
36  principalColumn: "Id",
37  onDelete: ReferentialAction.Cascade);
38  }
39 
44  protected override void Down(MigrationBuilder migrationBuilder)
45  {
46  if (migrationBuilder == null)
47  throw new ArgumentNullException(nameof(migrationBuilder));
48 
49  migrationBuilder.DropForeignKey(
50  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
51  table: "ReattachInformations");
52 
53  migrationBuilder.AlterColumn<long>(
54  name: "CompileJobId",
55  table: "ReattachInformations",
56  nullable: true,
57  oldClrType: typeof(long));
58 
59  migrationBuilder.AddForeignKey(
60  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
61  table: "ReattachInformations",
62  column: "CompileJobId",
63  principalTable: "CompileJobs",
64  principalColumn: "Id",
65  onDelete: ReferentialAction.Restrict);
66  }
67  }
68 }
+
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
+
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
+
Marks the Models.CompileJobs of Models.ReattachInformations as non-nullable for MSSQL
+
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MYReattachCompileJobRequired
 Marks the CompileJobs of ReattachInformations as non-nullable for MySQL/MariaDB More...
class  Tgstation.Server.Host.Database.Migrations.MYReattachCompileJobRequired
 Marks the Models.CompileJobs of Models.ReattachInformations as non-nullable for MySQL/MariaDB More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180926034014___m_y_reattach_compile_job_required_8_designer_8cs_source.html b/20180926034014___m_y_reattach_compile_job_required_8_designer_8cs_source.html index 701efc7ea6..55d2a31b56 100644 --- a/20180926034014___m_y_reattach_compile_job_required_8_designer_8cs_source.html +++ b/20180926034014___m_y_reattach_compile_job_required_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180926034014_MYReattachCompileJobRequired.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180926034014_MYReattachCompileJobRequired.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20180926034014_MYReattachCompileJobRequired.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
7 
9 {
11  [Migration("20180926034014_MYReattachCompileJobRequired")]
12  partial class MYReattachCompileJobRequired
13  {
18  protected override void BuildTargetModel(ModelBuilder modelBuilder)
19  {
20 #pragma warning disable 612, 618
21  modelBuilder
22  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
23  .HasAnnotation("Relational:MaxIdentifierLength", 64);
24 
25  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
26  {
27  b.Property<long>("Id")
28  .ValueGeneratedOnAdd();
29 
30  b.Property<string>("ConnectionString")
31  .IsRequired();
32 
33  b.Property<bool?>("Enabled");
34 
35  b.Property<long>("InstanceId");
36 
37  b.Property<string>("Name")
38  .IsRequired();
39 
40  b.Property<int?>("Provider");
41 
42  b.HasKey("Id");
43 
44  b.HasIndex("InstanceId");
45 
46  b.HasIndex("Name")
47  .IsUnique();
48 
49  b.ToTable("ChatBots");
50  });
51 
52  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
53  {
54  b.Property<long>("Id")
55  .ValueGeneratedOnAdd();
56 
57  b.Property<long>("ChatSettingsId");
58 
59  b.Property<ulong?>("DiscordChannelId");
60 
61  b.Property<string>("IrcChannel");
62 
63  b.Property<bool?>("IsAdminChannel")
64  .IsRequired();
65 
66  b.Property<bool?>("IsUpdatesChannel")
67  .IsRequired();
68 
69  b.Property<bool?>("IsWatchdogChannel")
70  .IsRequired();
71 
72  b.Property<string>("Tag");
73 
74  b.HasKey("Id");
75 
76  b.HasIndex("ChatSettingsId", "DiscordChannelId")
77  .IsUnique();
78 
79  b.HasIndex("ChatSettingsId", "IrcChannel")
80  .IsUnique();
81 
82  b.ToTable("ChatChannels");
83  });
84 
85  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
86  {
87  b.Property<long>("Id")
88  .ValueGeneratedOnAdd();
89 
90  b.Property<string>("ByondVersion")
91  .IsRequired();
92 
93  b.Property<Guid?>("DirectoryName")
94  .IsRequired();
95 
96  b.Property<string>("DmeName")
97  .IsRequired();
98 
99  b.Property<long>("JobId");
100 
101  b.Property<int>("MinimumSecurityLevel");
102 
103  b.Property<string>("Output")
104  .IsRequired();
105 
106  b.Property<long>("RevisionInformationId");
107 
108  b.HasKey("Id");
109 
110  b.HasIndex("DirectoryName");
111 
112  b.HasIndex("JobId")
113  .IsUnique();
114 
115  b.HasIndex("RevisionInformationId");
116 
117  b.ToTable("CompileJobs");
118  });
119 
120  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
121  {
122  b.Property<long>("Id")
123  .ValueGeneratedOnAdd();
124 
125  b.Property<string>("AccessToken");
126 
127  b.Property<bool?>("AllowWebClient")
128  .IsRequired();
129 
130  b.Property<bool?>("AutoStart")
131  .IsRequired();
132 
133  b.Property<long>("InstanceId");
134 
135  b.Property<ushort?>("PrimaryPort")
136  .IsRequired();
137 
138  b.Property<int?>("ProcessId");
139 
140  b.Property<ushort?>("SecondaryPort")
141  .IsRequired();
142 
143  b.Property<int>("SecurityLevel");
144 
145  b.Property<bool?>("SoftRestart")
146  .IsRequired();
147 
148  b.Property<bool?>("SoftShutdown")
149  .IsRequired();
150 
151  b.Property<uint?>("StartupTimeout")
152  .IsRequired();
153 
154  b.HasKey("Id");
155 
156  b.HasIndex("InstanceId")
157  .IsUnique();
158 
159  b.ToTable("DreamDaemonSettings");
160  });
161 
162  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
163  {
164  b.Property<long>("Id")
165  .ValueGeneratedOnAdd();
166 
167  b.Property<ushort?>("ApiValidationPort")
168  .IsRequired();
169 
170  b.Property<int>("ApiValidationSecurityLevel");
171 
172  b.Property<long>("InstanceId");
173 
174  b.Property<string>("ProjectName");
175 
176  b.HasKey("Id");
177 
178  b.HasIndex("InstanceId")
179  .IsUnique();
180 
181  b.ToTable("DreamMakerSettings");
182  });
183 
184  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
185  {
186  b.Property<long>("Id")
187  .ValueGeneratedOnAdd();
188 
189  b.Property<uint?>("AutoUpdateInterval")
190  .IsRequired();
191 
192  b.Property<int>("ConfigurationType");
193 
194  b.Property<string>("Name")
195  .IsRequired();
196 
197  b.Property<bool?>("Online")
198  .IsRequired();
199 
200  b.Property<string>("Path")
201  .IsRequired();
202 
203  b.HasKey("Id");
204 
205  b.HasIndex("Path")
206  .IsUnique();
207 
208  b.ToTable("Instances");
209  });
210 
211  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
212  {
213  b.Property<long>("Id")
214  .ValueGeneratedOnAdd();
215 
216  b.Property<ulong>("ByondRights");
217 
218  b.Property<ulong>("ChatBotRights");
219 
220  b.Property<ulong>("ConfigurationRights");
221 
222  b.Property<ulong>("DreamDaemonRights");
223 
224  b.Property<ulong>("DreamMakerRights");
225 
226  b.Property<long>("InstanceId");
227 
228  b.Property<ulong>("InstanceUserRights");
229 
230  b.Property<ulong>("RepositoryRights");
231 
232  b.Property<long?>("UserId")
233  .IsRequired();
234 
235  b.HasKey("Id");
236 
237  b.HasIndex("InstanceId");
238 
239  b.HasIndex("UserId", "InstanceId")
240  .IsUnique();
241 
242  b.ToTable("InstanceUsers");
243  });
244 
245  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
246  {
247  b.Property<long>("Id")
248  .ValueGeneratedOnAdd();
249 
250  b.Property<ulong?>("CancelRight");
251 
252  b.Property<ulong?>("CancelRightsType");
253 
254  b.Property<bool?>("Cancelled")
255  .IsRequired();
256 
257  b.Property<long?>("CancelledById");
258 
259  b.Property<string>("Description")
260  .IsRequired();
261 
262  b.Property<string>("ExceptionDetails");
263 
264  b.Property<long>("InstanceId");
265 
266  b.Property<DateTimeOffset?>("StartedAt")
267  .IsRequired();
268 
269  b.Property<long>("StartedById");
270 
271  b.Property<DateTimeOffset?>("StoppedAt");
272 
273  b.HasKey("Id");
274 
275  b.HasIndex("CancelledById");
276 
277  b.HasIndex("InstanceId");
278 
279  b.HasIndex("StartedById");
280 
281  b.ToTable("Jobs");
282  });
283 
284  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
285  {
286  b.Property<long>("Id")
287  .ValueGeneratedOnAdd();
288 
289  b.Property<string>("AccessIdentifier")
290  .IsRequired();
291 
292  b.Property<string>("ChatChannelsJson")
293  .IsRequired();
294 
295  b.Property<string>("ChatCommandsJson")
296  .IsRequired();
297 
298  b.Property<long>("CompileJobId");
299 
300  b.Property<bool>("IsPrimary");
301 
302  b.Property<ushort>("Port");
303 
304  b.Property<int>("ProcessId");
305 
306  b.Property<int>("RebootState");
307 
308  b.Property<string>("ServerCommandsJson")
309  .IsRequired();
310 
311  b.HasKey("Id");
312 
313  b.HasIndex("CompileJobId");
314 
315  b.ToTable("ReattachInformations");
316  });
317 
318  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
319  {
320  b.Property<long>("Id")
321  .ValueGeneratedOnAdd();
322 
323  b.Property<string>("AccessToken");
324 
325  b.Property<string>("AccessUser");
326 
327  b.Property<bool?>("AutoUpdatesKeepTestMerges")
328  .IsRequired();
329 
330  b.Property<bool?>("AutoUpdatesSynchronize")
331  .IsRequired();
332 
333  b.Property<string>("CommitterEmail")
334  .IsRequired();
335 
336  b.Property<string>("CommitterName")
337  .IsRequired();
338 
339  b.Property<long>("InstanceId");
340 
341  b.Property<bool?>("PushTestMergeCommits")
342  .IsRequired();
343 
344  b.Property<bool?>("ShowTestMergeCommitters")
345  .IsRequired();
346 
347  b.HasKey("Id");
348 
349  b.HasIndex("InstanceId")
350  .IsUnique();
351 
352  b.ToTable("RepositorySettings");
353  });
354 
355  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
356  {
357  b.Property<long>("Id")
358  .ValueGeneratedOnAdd();
359 
360  b.Property<long>("RevisionInformationId");
361 
362  b.Property<long>("TestMergeId");
363 
364  b.HasKey("Id");
365 
366  b.HasIndex("RevisionInformationId");
367 
368  b.HasIndex("TestMergeId");
369 
370  b.ToTable("RevInfoTestMerges");
371  });
372 
373  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
374  {
375  b.Property<long>("Id")
376  .ValueGeneratedOnAdd();
377 
378  b.Property<string>("CommitSha")
379  .IsRequired()
380  .HasMaxLength(40);
381 
382  b.Property<long>("InstanceId");
383 
384  b.Property<string>("OriginCommitSha")
385  .IsRequired()
386  .HasMaxLength(40);
387 
388  b.HasKey("Id");
389 
390  b.HasIndex("CommitSha")
391  .IsUnique();
392 
393  b.HasIndex("InstanceId");
394 
395  b.ToTable("RevisionInformations");
396  });
397 
398  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
399  {
400  b.Property<long>("Id")
401  .ValueGeneratedOnAdd();
402 
403  b.Property<string>("Author")
404  .IsRequired();
405 
406  b.Property<string>("BodyAtMerge")
407  .IsRequired();
408 
409  b.Property<string>("Comment");
410 
411  b.Property<DateTimeOffset>("MergedAt");
412 
413  b.Property<long>("MergedById");
414 
415  b.Property<int?>("Number")
416  .IsRequired();
417 
418  b.Property<long?>("PrimaryRevisionInformationId")
419  .IsRequired();
420 
421  b.Property<string>("PullRequestRevision")
422  .IsRequired();
423 
424  b.Property<string>("TitleAtMerge")
425  .IsRequired();
426 
427  b.Property<string>("Url")
428  .IsRequired();
429 
430  b.HasKey("Id");
431 
432  b.HasIndex("MergedById");
433 
434  b.HasIndex("PrimaryRevisionInformationId")
435  .IsUnique();
436 
437  b.ToTable("TestMerges");
438  });
439 
440  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
441  {
442  b.Property<long>("Id")
443  .ValueGeneratedOnAdd();
444 
445  b.Property<ulong>("AdministrationRights");
446 
447  b.Property<string>("CanonicalName")
448  .IsRequired();
449 
450  b.Property<DateTimeOffset?>("CreatedAt")
451  .IsRequired();
452 
453  b.Property<long?>("CreatedById");
454 
455  b.Property<bool?>("Enabled")
456  .IsRequired();
457 
458  b.Property<ulong>("InstanceManagerRights");
459 
460  b.Property<DateTimeOffset?>("LastPasswordUpdate");
461 
462  b.Property<string>("Name")
463  .IsRequired();
464 
465  b.Property<string>("PasswordHash");
466 
467  b.Property<string>("SystemIdentifier");
468 
469  b.HasKey("Id");
470 
471  b.HasIndex("CanonicalName")
472  .IsUnique();
473 
474  b.HasIndex("CreatedById");
475 
476  b.ToTable("Users");
477  });
478 
479  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
480  {
481  b.Property<long>("Id")
482  .ValueGeneratedOnAdd();
483 
484  b.Property<long?>("AlphaId");
485 
486  b.Property<bool>("AlphaIsActive");
487 
488  b.Property<long?>("BravoId");
489 
490  b.Property<long>("InstanceId");
491 
492  b.HasKey("Id");
493 
494  b.HasIndex("AlphaId");
495 
496  b.HasIndex("BravoId");
497 
498  b.HasIndex("InstanceId")
499  .IsUnique();
500 
501  b.ToTable("WatchdogReattachInformations");
502  });
503 
504  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
505  {
506  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
507  .WithMany("ChatSettings")
508  .HasForeignKey("InstanceId")
509  .OnDelete(DeleteBehavior.Cascade);
510  });
511 
512  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
513  {
514  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
515  .WithMany("Channels")
516  .HasForeignKey("ChatSettingsId")
517  .OnDelete(DeleteBehavior.Cascade);
518  });
519 
520  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
521  {
522  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
523  .WithOne()
524  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
525  .OnDelete(DeleteBehavior.Restrict);
526 
527  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
528  .WithMany("CompileJobs")
529  .HasForeignKey("RevisionInformationId")
530  .OnDelete(DeleteBehavior.Cascade);
531  });
532 
533  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
534  {
535  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
536  .WithOne("DreamDaemonSettings")
537  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
538  .OnDelete(DeleteBehavior.Cascade);
539  });
540 
541  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
542  {
543  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
544  .WithOne("DreamMakerSettings")
545  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
546  .OnDelete(DeleteBehavior.Cascade);
547  });
548 
549  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
550  {
551  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
552  .WithMany("InstanceUsers")
553  .HasForeignKey("InstanceId")
554  .OnDelete(DeleteBehavior.Cascade);
555 
556  b.HasOne("Tgstation.Server.Host.Models.User")
557  .WithMany("InstanceUsers")
558  .HasForeignKey("UserId")
559  .OnDelete(DeleteBehavior.Cascade);
560  });
561 
562  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
563  {
564  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
565  .WithMany()
566  .HasForeignKey("CancelledById");
567 
568  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
569  .WithMany("Jobs")
570  .HasForeignKey("InstanceId")
571  .OnDelete(DeleteBehavior.Cascade);
572 
573  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
574  .WithMany()
575  .HasForeignKey("StartedById")
576  .OnDelete(DeleteBehavior.Cascade);
577  });
578 
579  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
580  {
581  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
582  .WithMany()
583  .HasForeignKey("CompileJobId")
584  .OnDelete(DeleteBehavior.Cascade);
585  });
586 
587  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
588  {
589  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
590  .WithOne("RepositorySettings")
591  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
592  .OnDelete(DeleteBehavior.Cascade);
593  });
594 
595  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
596  {
597  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
598  .WithMany("ActiveTestMerges")
599  .HasForeignKey("RevisionInformationId")
600  .OnDelete(DeleteBehavior.Cascade);
601 
602  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
603  .WithMany("RevisonInformations")
604  .HasForeignKey("TestMergeId")
605  .OnDelete(DeleteBehavior.Cascade);
606  });
607 
608  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
609  {
610  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
611  .WithMany("RevisionInformations")
612  .HasForeignKey("InstanceId")
613  .OnDelete(DeleteBehavior.Cascade);
614  });
615 
616  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
617  {
618  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
619  .WithMany("TestMerges")
620  .HasForeignKey("MergedById")
621  .OnDelete(DeleteBehavior.Restrict);
622 
623  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
624  .WithOne("PrimaryTestMerge")
625  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
626  .OnDelete(DeleteBehavior.Restrict);
627  });
628 
629  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
630  {
631  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
632  .WithMany("CreatedUsers")
633  .HasForeignKey("CreatedById");
634  });
635 
636  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
637  {
638  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
639  .WithMany()
640  .HasForeignKey("AlphaId");
641 
642  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
643  .WithMany()
644  .HasForeignKey("BravoId");
645 
646  b.HasOne("Tgstation.Server.Host.Models.Instance")
647  .WithOne("WatchdogReattachInformation")
648  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
649  .OnDelete(DeleteBehavior.Cascade);
650  });
651 #pragma warning restore 612, 618
652  }
653  }
654 }
- +Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
6 
8 {
9  [DbContext(typeof(MySqlDatabaseContext))]
10  [Migration("20180926034014_MYReattachCompileJobRequired")]
11  partial class MYReattachCompileJobRequired
12  {
17  protected override void BuildTargetModel(ModelBuilder modelBuilder)
18  {
19 #pragma warning disable 612, 618
20  modelBuilder
21  .HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
22  .HasAnnotation("Relational:MaxIdentifierLength", 64);
23 
24  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
25  {
26  b.Property<long>("Id")
27  .ValueGeneratedOnAdd();
28 
29  b.Property<string>("ConnectionString")
30  .IsRequired();
31 
32  b.Property<bool?>("Enabled");
33 
34  b.Property<long>("InstanceId");
35 
36  b.Property<string>("Name")
37  .IsRequired();
38 
39  b.Property<int?>("Provider");
40 
41  b.HasKey("Id");
42 
43  b.HasIndex("InstanceId");
44 
45  b.HasIndex("Name")
46  .IsUnique();
47 
48  b.ToTable("ChatBots");
49  });
50 
51  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
52  {
53  b.Property<long>("Id")
54  .ValueGeneratedOnAdd();
55 
56  b.Property<long>("ChatSettingsId");
57 
58  b.Property<ulong?>("DiscordChannelId");
59 
60  b.Property<string>("IrcChannel");
61 
62  b.Property<bool?>("IsAdminChannel")
63  .IsRequired();
64 
65  b.Property<bool?>("IsUpdatesChannel")
66  .IsRequired();
67 
68  b.Property<bool?>("IsWatchdogChannel")
69  .IsRequired();
70 
71  b.Property<string>("Tag");
72 
73  b.HasKey("Id");
74 
75  b.HasIndex("ChatSettingsId", "DiscordChannelId")
76  .IsUnique();
77 
78  b.HasIndex("ChatSettingsId", "IrcChannel")
79  .IsUnique();
80 
81  b.ToTable("ChatChannels");
82  });
83 
84  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
85  {
86  b.Property<long>("Id")
87  .ValueGeneratedOnAdd();
88 
89  b.Property<string>("ByondVersion")
90  .IsRequired();
91 
92  b.Property<Guid?>("DirectoryName")
93  .IsRequired();
94 
95  b.Property<string>("DmeName")
96  .IsRequired();
97 
98  b.Property<long>("JobId");
99 
100  b.Property<int>("MinimumSecurityLevel");
101 
102  b.Property<string>("Output")
103  .IsRequired();
104 
105  b.Property<long>("RevisionInformationId");
106 
107  b.HasKey("Id");
108 
109  b.HasIndex("DirectoryName");
110 
111  b.HasIndex("JobId")
112  .IsUnique();
113 
114  b.HasIndex("RevisionInformationId");
115 
116  b.ToTable("CompileJobs");
117  });
118 
119  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
120  {
121  b.Property<long>("Id")
122  .ValueGeneratedOnAdd();
123 
124  b.Property<string>("AccessToken");
125 
126  b.Property<bool?>("AllowWebClient")
127  .IsRequired();
128 
129  b.Property<bool?>("AutoStart")
130  .IsRequired();
131 
132  b.Property<long>("InstanceId");
133 
134  b.Property<ushort?>("PrimaryPort")
135  .IsRequired();
136 
137  b.Property<int?>("ProcessId");
138 
139  b.Property<ushort?>("SecondaryPort")
140  .IsRequired();
141 
142  b.Property<int>("SecurityLevel");
143 
144  b.Property<bool?>("SoftRestart")
145  .IsRequired();
146 
147  b.Property<bool?>("SoftShutdown")
148  .IsRequired();
149 
150  b.Property<uint?>("StartupTimeout")
151  .IsRequired();
152 
153  b.HasKey("Id");
154 
155  b.HasIndex("InstanceId")
156  .IsUnique();
157 
158  b.ToTable("DreamDaemonSettings");
159  });
160 
161  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
162  {
163  b.Property<long>("Id")
164  .ValueGeneratedOnAdd();
165 
166  b.Property<ushort?>("ApiValidationPort")
167  .IsRequired();
168 
169  b.Property<int>("ApiValidationSecurityLevel");
170 
171  b.Property<long>("InstanceId");
172 
173  b.Property<string>("ProjectName");
174 
175  b.HasKey("Id");
176 
177  b.HasIndex("InstanceId")
178  .IsUnique();
179 
180  b.ToTable("DreamMakerSettings");
181  });
182 
183  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
184  {
185  b.Property<long>("Id")
186  .ValueGeneratedOnAdd();
187 
188  b.Property<uint?>("AutoUpdateInterval")
189  .IsRequired();
190 
191  b.Property<int>("ConfigurationType");
192 
193  b.Property<string>("Name")
194  .IsRequired();
195 
196  b.Property<bool?>("Online")
197  .IsRequired();
198 
199  b.Property<string>("Path")
200  .IsRequired();
201 
202  b.HasKey("Id");
203 
204  b.HasIndex("Path")
205  .IsUnique();
206 
207  b.ToTable("Instances");
208  });
209 
210  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
211  {
212  b.Property<long>("Id")
213  .ValueGeneratedOnAdd();
214 
215  b.Property<ulong>("ByondRights");
216 
217  b.Property<ulong>("ChatBotRights");
218 
219  b.Property<ulong>("ConfigurationRights");
220 
221  b.Property<ulong>("DreamDaemonRights");
222 
223  b.Property<ulong>("DreamMakerRights");
224 
225  b.Property<long>("InstanceId");
226 
227  b.Property<ulong>("InstanceUserRights");
228 
229  b.Property<ulong>("RepositoryRights");
230 
231  b.Property<long?>("UserId")
232  .IsRequired();
233 
234  b.HasKey("Id");
235 
236  b.HasIndex("InstanceId");
237 
238  b.HasIndex("UserId", "InstanceId")
239  .IsUnique();
240 
241  b.ToTable("InstanceUsers");
242  });
243 
244  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
245  {
246  b.Property<long>("Id")
247  .ValueGeneratedOnAdd();
248 
249  b.Property<ulong?>("CancelRight");
250 
251  b.Property<ulong?>("CancelRightsType");
252 
253  b.Property<bool?>("Cancelled")
254  .IsRequired();
255 
256  b.Property<long?>("CancelledById");
257 
258  b.Property<string>("Description")
259  .IsRequired();
260 
261  b.Property<string>("ExceptionDetails");
262 
263  b.Property<long>("InstanceId");
264 
265  b.Property<DateTimeOffset?>("StartedAt")
266  .IsRequired();
267 
268  b.Property<long>("StartedById");
269 
270  b.Property<DateTimeOffset?>("StoppedAt");
271 
272  b.HasKey("Id");
273 
274  b.HasIndex("CancelledById");
275 
276  b.HasIndex("InstanceId");
277 
278  b.HasIndex("StartedById");
279 
280  b.ToTable("Jobs");
281  });
282 
283  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
284  {
285  b.Property<long>("Id")
286  .ValueGeneratedOnAdd();
287 
288  b.Property<string>("AccessIdentifier")
289  .IsRequired();
290 
291  b.Property<string>("ChatChannelsJson")
292  .IsRequired();
293 
294  b.Property<string>("ChatCommandsJson")
295  .IsRequired();
296 
297  b.Property<long>("CompileJobId");
298 
299  b.Property<bool>("IsPrimary");
300 
301  b.Property<ushort>("Port");
302 
303  b.Property<int>("ProcessId");
304 
305  b.Property<int>("RebootState");
306 
307  b.Property<string>("ServerCommandsJson")
308  .IsRequired();
309 
310  b.HasKey("Id");
311 
312  b.HasIndex("CompileJobId");
313 
314  b.ToTable("ReattachInformations");
315  });
316 
317  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
318  {
319  b.Property<long>("Id")
320  .ValueGeneratedOnAdd();
321 
322  b.Property<string>("AccessToken");
323 
324  b.Property<string>("AccessUser");
325 
326  b.Property<bool?>("AutoUpdatesKeepTestMerges")
327  .IsRequired();
328 
329  b.Property<bool?>("AutoUpdatesSynchronize")
330  .IsRequired();
331 
332  b.Property<string>("CommitterEmail")
333  .IsRequired();
334 
335  b.Property<string>("CommitterName")
336  .IsRequired();
337 
338  b.Property<long>("InstanceId");
339 
340  b.Property<bool?>("PushTestMergeCommits")
341  .IsRequired();
342 
343  b.Property<bool?>("ShowTestMergeCommitters")
344  .IsRequired();
345 
346  b.HasKey("Id");
347 
348  b.HasIndex("InstanceId")
349  .IsUnique();
350 
351  b.ToTable("RepositorySettings");
352  });
353 
354  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
355  {
356  b.Property<long>("Id")
357  .ValueGeneratedOnAdd();
358 
359  b.Property<long>("RevisionInformationId");
360 
361  b.Property<long>("TestMergeId");
362 
363  b.HasKey("Id");
364 
365  b.HasIndex("RevisionInformationId");
366 
367  b.HasIndex("TestMergeId");
368 
369  b.ToTable("RevInfoTestMerges");
370  });
371 
372  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
373  {
374  b.Property<long>("Id")
375  .ValueGeneratedOnAdd();
376 
377  b.Property<string>("CommitSha")
378  .IsRequired()
379  .HasMaxLength(40);
380 
381  b.Property<long>("InstanceId");
382 
383  b.Property<string>("OriginCommitSha")
384  .IsRequired()
385  .HasMaxLength(40);
386 
387  b.HasKey("Id");
388 
389  b.HasIndex("CommitSha")
390  .IsUnique();
391 
392  b.HasIndex("InstanceId");
393 
394  b.ToTable("RevisionInformations");
395  });
396 
397  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
398  {
399  b.Property<long>("Id")
400  .ValueGeneratedOnAdd();
401 
402  b.Property<string>("Author")
403  .IsRequired();
404 
405  b.Property<string>("BodyAtMerge")
406  .IsRequired();
407 
408  b.Property<string>("Comment");
409 
410  b.Property<DateTimeOffset>("MergedAt");
411 
412  b.Property<long>("MergedById");
413 
414  b.Property<int?>("Number")
415  .IsRequired();
416 
417  b.Property<long?>("PrimaryRevisionInformationId")
418  .IsRequired();
419 
420  b.Property<string>("PullRequestRevision")
421  .IsRequired();
422 
423  b.Property<string>("TitleAtMerge")
424  .IsRequired();
425 
426  b.Property<string>("Url")
427  .IsRequired();
428 
429  b.HasKey("Id");
430 
431  b.HasIndex("MergedById");
432 
433  b.HasIndex("PrimaryRevisionInformationId")
434  .IsUnique();
435 
436  b.ToTable("TestMerges");
437  });
438 
439  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
440  {
441  b.Property<long>("Id")
442  .ValueGeneratedOnAdd();
443 
444  b.Property<ulong>("AdministrationRights");
445 
446  b.Property<string>("CanonicalName")
447  .IsRequired();
448 
449  b.Property<DateTimeOffset?>("CreatedAt")
450  .IsRequired();
451 
452  b.Property<long?>("CreatedById");
453 
454  b.Property<bool?>("Enabled")
455  .IsRequired();
456 
457  b.Property<ulong>("InstanceManagerRights");
458 
459  b.Property<DateTimeOffset?>("LastPasswordUpdate");
460 
461  b.Property<string>("Name")
462  .IsRequired();
463 
464  b.Property<string>("PasswordHash");
465 
466  b.Property<string>("SystemIdentifier");
467 
468  b.HasKey("Id");
469 
470  b.HasIndex("CanonicalName")
471  .IsUnique();
472 
473  b.HasIndex("CreatedById");
474 
475  b.ToTable("Users");
476  });
477 
478  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
479  {
480  b.Property<long>("Id")
481  .ValueGeneratedOnAdd();
482 
483  b.Property<long?>("AlphaId");
484 
485  b.Property<bool>("AlphaIsActive");
486 
487  b.Property<long?>("BravoId");
488 
489  b.Property<long>("InstanceId");
490 
491  b.HasKey("Id");
492 
493  b.HasIndex("AlphaId");
494 
495  b.HasIndex("BravoId");
496 
497  b.HasIndex("InstanceId")
498  .IsUnique();
499 
500  b.ToTable("WatchdogReattachInformations");
501  });
502 
503  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
504  {
505  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
506  .WithMany("ChatSettings")
507  .HasForeignKey("InstanceId")
508  .OnDelete(DeleteBehavior.Cascade);
509  });
510 
511  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
512  {
513  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
514  .WithMany("Channels")
515  .HasForeignKey("ChatSettingsId")
516  .OnDelete(DeleteBehavior.Cascade);
517  });
518 
519  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
520  {
521  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
522  .WithOne()
523  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
524  .OnDelete(DeleteBehavior.Restrict);
525 
526  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
527  .WithMany("CompileJobs")
528  .HasForeignKey("RevisionInformationId")
529  .OnDelete(DeleteBehavior.Cascade);
530  });
531 
532  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
533  {
534  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
535  .WithOne("DreamDaemonSettings")
536  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
537  .OnDelete(DeleteBehavior.Cascade);
538  });
539 
540  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
541  {
542  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
543  .WithOne("DreamMakerSettings")
544  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
545  .OnDelete(DeleteBehavior.Cascade);
546  });
547 
548  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
549  {
550  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
551  .WithMany("InstanceUsers")
552  .HasForeignKey("InstanceId")
553  .OnDelete(DeleteBehavior.Cascade);
554 
555  b.HasOne("Tgstation.Server.Host.Models.User")
556  .WithMany("InstanceUsers")
557  .HasForeignKey("UserId")
558  .OnDelete(DeleteBehavior.Cascade);
559  });
560 
561  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
562  {
563  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
564  .WithMany()
565  .HasForeignKey("CancelledById");
566 
567  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
568  .WithMany("Jobs")
569  .HasForeignKey("InstanceId")
570  .OnDelete(DeleteBehavior.Cascade);
571 
572  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
573  .WithMany()
574  .HasForeignKey("StartedById")
575  .OnDelete(DeleteBehavior.Cascade);
576  });
577 
578  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
579  {
580  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
581  .WithMany()
582  .HasForeignKey("CompileJobId")
583  .OnDelete(DeleteBehavior.Cascade);
584  });
585 
586  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
587  {
588  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
589  .WithOne("RepositorySettings")
590  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
591  .OnDelete(DeleteBehavior.Cascade);
592  });
593 
594  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
595  {
596  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
597  .WithMany("ActiveTestMerges")
598  .HasForeignKey("RevisionInformationId")
599  .OnDelete(DeleteBehavior.Cascade);
600 
601  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
602  .WithMany("RevisonInformations")
603  .HasForeignKey("TestMergeId")
604  .OnDelete(DeleteBehavior.Cascade);
605  });
606 
607  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
608  {
609  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
610  .WithMany("RevisionInformations")
611  .HasForeignKey("InstanceId")
612  .OnDelete(DeleteBehavior.Cascade);
613  });
614 
615  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
616  {
617  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
618  .WithMany("TestMerges")
619  .HasForeignKey("MergedById")
620  .OnDelete(DeleteBehavior.Restrict);
621 
622  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
623  .WithOne("PrimaryTestMerge")
624  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
625  .OnDelete(DeleteBehavior.Restrict);
626  });
627 
628  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
629  {
630  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
631  .WithMany("CreatedUsers")
632  .HasForeignKey("CreatedById");
633  });
634 
635  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
636  {
637  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
638  .WithMany()
639  .HasForeignKey("AlphaId");
640 
641  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
642  .WithMany()
643  .HasForeignKey("BravoId");
644 
645  b.HasOne("Tgstation.Server.Host.Models.Instance")
646  .WithOne("WatchdogReattachInformation")
647  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
648  .OnDelete(DeleteBehavior.Cascade);
649  });
650 #pragma warning restore 612, 618
651  }
652  }
653 }
+ -
DatabaseContext<TParentContext> for MySQL
- - - - - +
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MYReattachCompileJobRequired
 Marks the CompileJobs of ReattachInformations as non-nullable for MySQL/MariaDB More...
class  Tgstation.Server.Host.Database.Migrations.MYReattachCompileJobRequired
 Marks the Models.CompileJobs of Models.ReattachInformations as non-nullable for MySQL/MariaDB More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20180926034014___m_y_reattach_compile_job_required_8cs_source.html b/20180926034014___m_y_reattach_compile_job_required_8cs_source.html index 53509cd4d7..f143243799 100644 --- a/20180926034014___m_y_reattach_compile_job_required_8cs_source.html +++ b/20180926034014___m_y_reattach_compile_job_required_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20180926034014_MYReattachCompileJobRequired.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20180926034014_MYReattachCompileJobRequired.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,11 +71,11 @@ $(function() {
20180926034014_MYReattachCompileJobRequired.cs
-Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MYReattachCompileJobRequired : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropForeignKey(
21  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
22  table: "ReattachInformations");
23 
24  migrationBuilder.AlterColumn<long>(
25  name: "CompileJobId",
26  table: "ReattachInformations",
27  nullable: false,
28  oldClrType: typeof(long),
29  oldNullable: true);
30 
31  migrationBuilder.AddForeignKey(
32  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
33  table: "ReattachInformations",
34  column: "CompileJobId",
35  principalTable: "CompileJobs",
36  principalColumn: "Id",
37  onDelete: ReferentialAction.Cascade);
38  }
39 
44  protected override void Down(MigrationBuilder migrationBuilder)
45  {
46  if (migrationBuilder == null)
47  throw new ArgumentNullException(nameof(migrationBuilder));
48 
49  migrationBuilder.DropForeignKey(
50  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
51  table: "ReattachInformations");
52 
53  migrationBuilder.AlterColumn<long>(
54  name: "CompileJobId",
55  table: "ReattachInformations",
56  nullable: true,
57  oldClrType: typeof(long));
58 
59  migrationBuilder.AddForeignKey(
60  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
61  table: "ReattachInformations",
62  column: "CompileJobId",
63  principalTable: "CompileJobs",
64  principalColumn: "Id",
65  onDelete: ReferentialAction.Restrict);
66  }
67  }
68 }
Marks the CompileJobs of ReattachInformations as non-nullable for MySQL/MariaDB
- -
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
- -
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
+Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MYReattachCompileJobRequired : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropForeignKey(
21  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
22  table: "ReattachInformations");
23 
24  migrationBuilder.AlterColumn<long>(
25  name: "CompileJobId",
26  table: "ReattachInformations",
27  nullable: false,
28  oldClrType: typeof(long),
29  oldNullable: true);
30 
31  migrationBuilder.AddForeignKey(
32  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
33  table: "ReattachInformations",
34  column: "CompileJobId",
35  principalTable: "CompileJobs",
36  principalColumn: "Id",
37  onDelete: ReferentialAction.Cascade);
38  }
39 
44  protected override void Down(MigrationBuilder migrationBuilder)
45  {
46  if (migrationBuilder == null)
47  throw new ArgumentNullException(nameof(migrationBuilder));
48 
49  migrationBuilder.DropForeignKey(
50  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
51  table: "ReattachInformations");
52 
53  migrationBuilder.AlterColumn<long>(
54  name: "CompileJobId",
55  table: "ReattachInformations",
56  nullable: true,
57  oldClrType: typeof(long));
58 
59  migrationBuilder.AddForeignKey(
60  name: "FK_ReattachInformations_CompileJobs_CompileJobId",
61  table: "ReattachInformations",
62  column: "CompileJobId",
63  principalTable: "CompileJobs",
64  principalColumn: "Id",
65  onDelete: ReferentialAction.Restrict);
66  }
67  }
68 }
+
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
+
Marks the Models.CompileJobs of Models.ReattachInformations as non-nullable for MySQL/MariaDB
+ +
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
diff --git a/20181124231534___m_s_toggle_testmerge_comments_8_designer_8cs_source.html b/20181124231534___m_s_toggle_testmerge_comments_8_designer_8cs_source.html index bc40874138..80940b1767 100644 --- a/20181124231534___m_s_toggle_testmerge_comments_8_designer_8cs_source.html +++ b/20181124231534___m_s_toggle_testmerge_comments_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20181124231534_MSToggleTestmergeComments.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20181124231534_MSToggleTestmergeComments.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20181124231534_MSToggleTestmergeComments.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
9 
11 {
13  [Migration("20181124231534_MSToggleTestmergeComments")]
14  partial class MSToggleTestmergeComments
15  {
20  protected override void BuildTargetModel(ModelBuilder modelBuilder)
21  {
22 #pragma warning disable 612, 618
23  modelBuilder
24  .HasAnnotation("ProductVersion", "2.1.4-rtm-31024")
25  .HasAnnotation("Relational:MaxIdentifierLength", 128)
26  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
27 
28  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
29  {
30  b.Property<long>("Id")
31  .ValueGeneratedOnAdd()
32  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
33 
34  b.Property<string>("ConnectionString")
35  .IsRequired();
36 
37  b.Property<bool?>("Enabled");
38 
39  b.Property<long>("InstanceId");
40 
41  b.Property<string>("Name")
42  .IsRequired();
43 
44  b.Property<int?>("Provider");
45 
46  b.HasKey("Id");
47 
48  b.HasIndex("InstanceId");
49 
50  b.HasIndex("Name")
51  .IsUnique();
52 
53  b.ToTable("ChatBots");
54  });
55 
56  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
57  {
58  b.Property<long>("Id")
59  .ValueGeneratedOnAdd()
60  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
61 
62  b.Property<long>("ChatSettingsId");
63 
64  b.Property<decimal?>("DiscordChannelId")
65  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
66 
67  b.Property<string>("IrcChannel");
68 
69  b.Property<bool?>("IsAdminChannel")
70  .IsRequired();
71 
72  b.Property<bool?>("IsUpdatesChannel")
73  .IsRequired();
74 
75  b.Property<bool?>("IsWatchdogChannel")
76  .IsRequired();
77 
78  b.Property<string>("Tag");
79 
80  b.HasKey("Id");
81 
82  b.HasIndex("ChatSettingsId", "DiscordChannelId")
83  .IsUnique()
84  .HasFilter("[DiscordChannelId] IS NOT NULL");
85 
86  b.HasIndex("ChatSettingsId", "IrcChannel")
87  .IsUnique()
88  .HasFilter("[IrcChannel] IS NOT NULL");
89 
90  b.ToTable("ChatChannels");
91  });
92 
93  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
94  {
95  b.Property<long>("Id")
96  .ValueGeneratedOnAdd()
97  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
98 
99  b.Property<string>("ByondVersion")
100  .IsRequired();
101 
102  b.Property<Guid?>("DirectoryName")
103  .IsRequired();
104 
105  b.Property<string>("DmeName")
106  .IsRequired();
107 
108  b.Property<long>("JobId");
109 
110  b.Property<int>("MinimumSecurityLevel");
111 
112  b.Property<string>("Output")
113  .IsRequired();
114 
115  b.Property<long>("RevisionInformationId");
116 
117  b.HasKey("Id");
118 
119  b.HasIndex("DirectoryName");
120 
121  b.HasIndex("JobId")
122  .IsUnique();
123 
124  b.HasIndex("RevisionInformationId");
125 
126  b.ToTable("CompileJobs");
127  });
128 
129  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
130  {
131  b.Property<long>("Id")
132  .ValueGeneratedOnAdd()
133  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
134 
135  b.Property<string>("AccessToken");
136 
137  b.Property<bool?>("AllowWebClient")
138  .IsRequired();
139 
140  b.Property<bool?>("AutoStart")
141  .IsRequired();
142 
143  b.Property<long>("InstanceId");
144 
145  b.Property<int>("PrimaryPort");
146 
147  b.Property<int?>("ProcessId");
148 
149  b.Property<int>("SecondaryPort");
150 
151  b.Property<int>("SecurityLevel");
152 
153  b.Property<bool?>("SoftRestart")
154  .IsRequired();
155 
156  b.Property<bool?>("SoftShutdown")
157  .IsRequired();
158 
159  b.Property<long>("StartupTimeout");
160 
161  b.HasKey("Id");
162 
163  b.HasIndex("InstanceId")
164  .IsUnique();
165 
166  b.ToTable("DreamDaemonSettings");
167  });
168 
169  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
170  {
171  b.Property<long>("Id")
172  .ValueGeneratedOnAdd()
173  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
174 
175  b.Property<int>("ApiValidationPort");
176 
177  b.Property<int>("ApiValidationSecurityLevel");
178 
179  b.Property<long>("InstanceId");
180 
181  b.Property<string>("ProjectName");
182 
183  b.HasKey("Id");
184 
185  b.HasIndex("InstanceId")
186  .IsUnique();
187 
188  b.ToTable("DreamMakerSettings");
189  });
190 
191  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
192  {
193  b.Property<long>("Id")
194  .ValueGeneratedOnAdd()
195  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
196 
197  b.Property<long>("AutoUpdateInterval");
198 
199  b.Property<int>("ConfigurationType");
200 
201  b.Property<string>("Name")
202  .IsRequired();
203 
204  b.Property<bool?>("Online")
205  .IsRequired();
206 
207  b.Property<string>("Path")
208  .IsRequired();
209 
210  b.HasKey("Id");
211 
212  b.HasIndex("Path")
213  .IsUnique();
214 
215  b.ToTable("Instances");
216  });
217 
218  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
219  {
220  b.Property<long>("Id")
221  .ValueGeneratedOnAdd()
222  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
223 
224  b.Property<decimal>("ByondRights")
225  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
226 
227  b.Property<decimal>("ChatBotRights")
228  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
229 
230  b.Property<decimal>("ConfigurationRights")
231  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
232 
233  b.Property<decimal>("DreamDaemonRights")
234  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
235 
236  b.Property<decimal>("DreamMakerRights")
237  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
238 
239  b.Property<long>("InstanceId");
240 
241  b.Property<decimal>("InstanceUserRights")
242  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
243 
244  b.Property<decimal>("RepositoryRights")
245  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
246 
247  b.Property<long?>("UserId")
248  .IsRequired();
249 
250  b.HasKey("Id");
251 
252  b.HasIndex("InstanceId");
253 
254  b.HasIndex("UserId", "InstanceId")
255  .IsUnique();
256 
257  b.ToTable("InstanceUsers");
258  });
259 
260  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
261  {
262  b.Property<long>("Id")
263  .ValueGeneratedOnAdd()
264  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
265 
266  b.Property<decimal?>("CancelRight")
267  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
268 
269  b.Property<decimal?>("CancelRightsType")
270  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
271 
272  b.Property<bool?>("Cancelled")
273  .IsRequired();
274 
275  b.Property<long?>("CancelledById");
276 
277  b.Property<string>("Description")
278  .IsRequired();
279 
280  b.Property<string>("ExceptionDetails");
281 
282  b.Property<long>("InstanceId");
283 
284  b.Property<DateTimeOffset?>("StartedAt")
285  .IsRequired();
286 
287  b.Property<long>("StartedById");
288 
289  b.Property<DateTimeOffset?>("StoppedAt");
290 
291  b.HasKey("Id");
292 
293  b.HasIndex("CancelledById");
294 
295  b.HasIndex("InstanceId");
296 
297  b.HasIndex("StartedById");
298 
299  b.ToTable("Jobs");
300  });
301 
302  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
303  {
304  b.Property<long>("Id")
305  .ValueGeneratedOnAdd()
306  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
307 
308  b.Property<string>("AccessIdentifier")
309  .IsRequired();
310 
311  b.Property<string>("ChatChannelsJson")
312  .IsRequired();
313 
314  b.Property<string>("ChatCommandsJson")
315  .IsRequired();
316 
317  b.Property<long>("CompileJobId");
318 
319  b.Property<bool>("IsPrimary");
320 
321  b.Property<int>("Port");
322 
323  b.Property<int>("ProcessId");
324 
325  b.Property<int>("RebootState");
326 
327  b.Property<string>("ServerCommandsJson")
328  .IsRequired();
329 
330  b.HasKey("Id");
331 
332  b.HasIndex("CompileJobId");
333 
334  b.ToTable("ReattachInformations");
335  });
336 
337  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
338  {
339  b.Property<long>("Id")
340  .ValueGeneratedOnAdd()
341  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
342 
343  b.Property<string>("AccessToken");
344 
345  b.Property<string>("AccessUser");
346 
347  b.Property<bool?>("AutoUpdatesKeepTestMerges")
348  .IsRequired();
349 
350  b.Property<bool?>("AutoUpdatesSynchronize")
351  .IsRequired();
352 
353  b.Property<string>("CommitterEmail")
354  .IsRequired();
355 
356  b.Property<string>("CommitterName")
357  .IsRequired();
358 
359  b.Property<long>("InstanceId");
360 
361  b.Property<bool?>("PostTestMergeComment")
362  .IsRequired();
363 
364  b.Property<bool?>("PushTestMergeCommits")
365  .IsRequired();
366 
367  b.Property<bool?>("ShowTestMergeCommitters")
368  .IsRequired();
369 
370  b.HasKey("Id");
371 
372  b.HasIndex("InstanceId")
373  .IsUnique();
374 
375  b.ToTable("RepositorySettings");
376  });
377 
378  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
379  {
380  b.Property<long>("Id")
381  .ValueGeneratedOnAdd()
382  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
383 
384  b.Property<long>("RevisionInformationId");
385 
386  b.Property<long>("TestMergeId");
387 
388  b.HasKey("Id");
389 
390  b.HasIndex("RevisionInformationId");
391 
392  b.HasIndex("TestMergeId");
393 
394  b.ToTable("RevInfoTestMerges");
395  });
396 
397  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
398  {
399  b.Property<long>("Id")
400  .ValueGeneratedOnAdd()
401  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
402 
403  b.Property<string>("CommitSha")
404  .IsRequired()
405  .HasMaxLength(40);
406 
407  b.Property<long>("InstanceId");
408 
409  b.Property<string>("OriginCommitSha")
410  .IsRequired()
411  .HasMaxLength(40);
412 
413  b.HasKey("Id");
414 
415  b.HasIndex("CommitSha")
416  .IsUnique();
417 
418  b.HasIndex("InstanceId");
419 
420  b.ToTable("RevisionInformations");
421  });
422 
423  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
424  {
425  b.Property<long>("Id")
426  .ValueGeneratedOnAdd()
427  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
428 
429  b.Property<string>("Author")
430  .IsRequired();
431 
432  b.Property<string>("BodyAtMerge")
433  .IsRequired();
434 
435  b.Property<string>("Comment");
436 
437  b.Property<DateTimeOffset>("MergedAt");
438 
439  b.Property<long>("MergedById");
440 
441  b.Property<int?>("Number")
442  .IsRequired();
443 
444  b.Property<long?>("PrimaryRevisionInformationId")
445  .IsRequired();
446 
447  b.Property<string>("PullRequestRevision")
448  .IsRequired();
449 
450  b.Property<string>("TitleAtMerge")
451  .IsRequired();
452 
453  b.Property<string>("Url")
454  .IsRequired();
455 
456  b.HasKey("Id");
457 
458  b.HasIndex("MergedById");
459 
460  b.HasIndex("PrimaryRevisionInformationId")
461  .IsUnique();
462 
463  b.ToTable("TestMerges");
464  });
465 
466  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
467  {
468  b.Property<long>("Id")
469  .ValueGeneratedOnAdd()
470  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
471 
472  b.Property<decimal>("AdministrationRights")
473  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
474 
475  b.Property<string>("CanonicalName")
476  .IsRequired();
477 
478  b.Property<DateTimeOffset?>("CreatedAt")
479  .IsRequired();
480 
481  b.Property<long?>("CreatedById");
482 
483  b.Property<bool?>("Enabled")
484  .IsRequired();
485 
486  b.Property<decimal>("InstanceManagerRights")
487  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
488 
489  b.Property<DateTimeOffset?>("LastPasswordUpdate");
490 
491  b.Property<string>("Name")
492  .IsRequired();
493 
494  b.Property<string>("PasswordHash");
495 
496  b.Property<string>("SystemIdentifier");
497 
498  b.HasKey("Id");
499 
500  b.HasIndex("CanonicalName")
501  .IsUnique();
502 
503  b.HasIndex("CreatedById");
504 
505  b.ToTable("Users");
506  });
507 
508  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
509  {
510  b.Property<long>("Id")
511  .ValueGeneratedOnAdd()
512  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
513 
514  b.Property<long?>("AlphaId");
515 
516  b.Property<bool>("AlphaIsActive");
517 
518  b.Property<long?>("BravoId");
519 
520  b.Property<long>("InstanceId");
521 
522  b.HasKey("Id");
523 
524  b.HasIndex("AlphaId");
525 
526  b.HasIndex("BravoId");
527 
528  b.HasIndex("InstanceId")
529  .IsUnique();
530 
531  b.ToTable("WatchdogReattachInformations");
532  });
533 
534  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
535  {
536  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
537  .WithMany("ChatSettings")
538  .HasForeignKey("InstanceId")
539  .OnDelete(DeleteBehavior.Cascade);
540  });
541 
542  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
543  {
544  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
545  .WithMany("Channels")
546  .HasForeignKey("ChatSettingsId")
547  .OnDelete(DeleteBehavior.Cascade);
548  });
549 
550  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
551  {
552  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
553  .WithOne()
554  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
555  .OnDelete(DeleteBehavior.Restrict);
556 
557  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
558  .WithMany("CompileJobs")
559  .HasForeignKey("RevisionInformationId")
560  .OnDelete(DeleteBehavior.Cascade);
561  });
562 
563  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
564  {
565  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
566  .WithOne("DreamDaemonSettings")
567  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
568  .OnDelete(DeleteBehavior.Cascade);
569  });
570 
571  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
572  {
573  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
574  .WithOne("DreamMakerSettings")
575  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
576  .OnDelete(DeleteBehavior.Cascade);
577  });
578 
579  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
580  {
581  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
582  .WithMany("InstanceUsers")
583  .HasForeignKey("InstanceId")
584  .OnDelete(DeleteBehavior.Cascade);
585 
586  b.HasOne("Tgstation.Server.Host.Models.User")
587  .WithMany("InstanceUsers")
588  .HasForeignKey("UserId")
589  .OnDelete(DeleteBehavior.Cascade);
590  });
591 
592  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
593  {
594  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
595  .WithMany()
596  .HasForeignKey("CancelledById");
597 
598  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
599  .WithMany("Jobs")
600  .HasForeignKey("InstanceId")
601  .OnDelete(DeleteBehavior.Cascade);
602 
603  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
604  .WithMany()
605  .HasForeignKey("StartedById")
606  .OnDelete(DeleteBehavior.Cascade);
607  });
608 
609  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
610  {
611  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
612  .WithMany()
613  .HasForeignKey("CompileJobId")
614  .OnDelete(DeleteBehavior.Cascade);
615  });
616 
617  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
618  {
619  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
620  .WithOne("RepositorySettings")
621  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
622  .OnDelete(DeleteBehavior.Cascade);
623  });
624 
625  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
626  {
627  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
628  .WithMany("ActiveTestMerges")
629  .HasForeignKey("RevisionInformationId")
630  .OnDelete(DeleteBehavior.Cascade);
631 
632  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
633  .WithMany("RevisonInformations")
634  .HasForeignKey("TestMergeId")
635  .OnDelete(DeleteBehavior.Cascade);
636  });
637 
638  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
639  {
640  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
641  .WithMany("RevisionInformations")
642  .HasForeignKey("InstanceId")
643  .OnDelete(DeleteBehavior.Cascade);
644  });
645 
646  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
647  {
648  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
649  .WithMany("TestMerges")
650  .HasForeignKey("MergedById")
651  .OnDelete(DeleteBehavior.Restrict);
652 
653  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
654  .WithOne("PrimaryTestMerge")
655  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
656  .OnDelete(DeleteBehavior.Restrict);
657  });
658 
659  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
660  {
661  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
662  .WithMany("CreatedUsers")
663  .HasForeignKey("CreatedById");
664  });
665 
666  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
667  {
668  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
669  .WithMany()
670  .HasForeignKey("AlphaId");
671 
672  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
673  .WithMany()
674  .HasForeignKey("BravoId");
675 
676  b.HasOne("Tgstation.Server.Host.Models.Instance")
677  .WithOne("WatchdogReattachInformation")
678  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
679  .OnDelete(DeleteBehavior.Cascade);
680  });
681 #pragma warning restore 612, 618
682  }
683  }
684 }
+Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
8 
10 {
11  [DbContext(typeof(SqlServerDatabaseContext))]
12  [Migration("20181124231534_MSToggleTestmergeComments")]
13  partial class MSToggleTestmergeComments
14  {
19  protected override void BuildTargetModel(ModelBuilder modelBuilder)
20  {
21 #pragma warning disable 612, 618
22  modelBuilder
23  .HasAnnotation("ProductVersion", "2.1.4-rtm-31024")
24  .HasAnnotation("Relational:MaxIdentifierLength", 128)
25  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
26 
27  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
28  {
29  b.Property<long>("Id")
30  .ValueGeneratedOnAdd()
31  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
32 
33  b.Property<string>("ConnectionString")
34  .IsRequired();
35 
36  b.Property<bool?>("Enabled");
37 
38  b.Property<long>("InstanceId");
39 
40  b.Property<string>("Name")
41  .IsRequired();
42 
43  b.Property<int?>("Provider");
44 
45  b.HasKey("Id");
46 
47  b.HasIndex("InstanceId");
48 
49  b.HasIndex("Name")
50  .IsUnique();
51 
52  b.ToTable("ChatBots");
53  });
54 
55  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
56  {
57  b.Property<long>("Id")
58  .ValueGeneratedOnAdd()
59  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
60 
61  b.Property<long>("ChatSettingsId");
62 
63  b.Property<decimal?>("DiscordChannelId")
64  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
65 
66  b.Property<string>("IrcChannel");
67 
68  b.Property<bool?>("IsAdminChannel")
69  .IsRequired();
70 
71  b.Property<bool?>("IsUpdatesChannel")
72  .IsRequired();
73 
74  b.Property<bool?>("IsWatchdogChannel")
75  .IsRequired();
76 
77  b.Property<string>("Tag");
78 
79  b.HasKey("Id");
80 
81  b.HasIndex("ChatSettingsId", "DiscordChannelId")
82  .IsUnique()
83  .HasFilter("[DiscordChannelId] IS NOT NULL");
84 
85  b.HasIndex("ChatSettingsId", "IrcChannel")
86  .IsUnique()
87  .HasFilter("[IrcChannel] IS NOT NULL");
88 
89  b.ToTable("ChatChannels");
90  });
91 
92  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
93  {
94  b.Property<long>("Id")
95  .ValueGeneratedOnAdd()
96  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
97 
98  b.Property<string>("ByondVersion")
99  .IsRequired();
100 
101  b.Property<Guid?>("DirectoryName")
102  .IsRequired();
103 
104  b.Property<string>("DmeName")
105  .IsRequired();
106 
107  b.Property<long>("JobId");
108 
109  b.Property<int>("MinimumSecurityLevel");
110 
111  b.Property<string>("Output")
112  .IsRequired();
113 
114  b.Property<long>("RevisionInformationId");
115 
116  b.HasKey("Id");
117 
118  b.HasIndex("DirectoryName");
119 
120  b.HasIndex("JobId")
121  .IsUnique();
122 
123  b.HasIndex("RevisionInformationId");
124 
125  b.ToTable("CompileJobs");
126  });
127 
128  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
129  {
130  b.Property<long>("Id")
131  .ValueGeneratedOnAdd()
132  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
133 
134  b.Property<string>("AccessToken");
135 
136  b.Property<bool?>("AllowWebClient")
137  .IsRequired();
138 
139  b.Property<bool?>("AutoStart")
140  .IsRequired();
141 
142  b.Property<long>("InstanceId");
143 
144  b.Property<int>("PrimaryPort");
145 
146  b.Property<int?>("ProcessId");
147 
148  b.Property<int>("SecondaryPort");
149 
150  b.Property<int>("SecurityLevel");
151 
152  b.Property<bool?>("SoftRestart")
153  .IsRequired();
154 
155  b.Property<bool?>("SoftShutdown")
156  .IsRequired();
157 
158  b.Property<long>("StartupTimeout");
159 
160  b.HasKey("Id");
161 
162  b.HasIndex("InstanceId")
163  .IsUnique();
164 
165  b.ToTable("DreamDaemonSettings");
166  });
167 
168  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
169  {
170  b.Property<long>("Id")
171  .ValueGeneratedOnAdd()
172  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
173 
174  b.Property<int>("ApiValidationPort");
175 
176  b.Property<int>("ApiValidationSecurityLevel");
177 
178  b.Property<long>("InstanceId");
179 
180  b.Property<string>("ProjectName");
181 
182  b.HasKey("Id");
183 
184  b.HasIndex("InstanceId")
185  .IsUnique();
186 
187  b.ToTable("DreamMakerSettings");
188  });
189 
190  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
191  {
192  b.Property<long>("Id")
193  .ValueGeneratedOnAdd()
194  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
195 
196  b.Property<long>("AutoUpdateInterval");
197 
198  b.Property<int>("ConfigurationType");
199 
200  b.Property<string>("Name")
201  .IsRequired();
202 
203  b.Property<bool?>("Online")
204  .IsRequired();
205 
206  b.Property<string>("Path")
207  .IsRequired();
208 
209  b.HasKey("Id");
210 
211  b.HasIndex("Path")
212  .IsUnique();
213 
214  b.ToTable("Instances");
215  });
216 
217  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
218  {
219  b.Property<long>("Id")
220  .ValueGeneratedOnAdd()
221  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
222 
223  b.Property<decimal>("ByondRights")
224  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
225 
226  b.Property<decimal>("ChatBotRights")
227  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
228 
229  b.Property<decimal>("ConfigurationRights")
230  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
231 
232  b.Property<decimal>("DreamDaemonRights")
233  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
234 
235  b.Property<decimal>("DreamMakerRights")
236  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
237 
238  b.Property<long>("InstanceId");
239 
240  b.Property<decimal>("InstanceUserRights")
241  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
242 
243  b.Property<decimal>("RepositoryRights")
244  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
245 
246  b.Property<long?>("UserId")
247  .IsRequired();
248 
249  b.HasKey("Id");
250 
251  b.HasIndex("InstanceId");
252 
253  b.HasIndex("UserId", "InstanceId")
254  .IsUnique();
255 
256  b.ToTable("InstanceUsers");
257  });
258 
259  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
260  {
261  b.Property<long>("Id")
262  .ValueGeneratedOnAdd()
263  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
264 
265  b.Property<decimal?>("CancelRight")
266  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
267 
268  b.Property<decimal?>("CancelRightsType")
269  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
270 
271  b.Property<bool?>("Cancelled")
272  .IsRequired();
273 
274  b.Property<long?>("CancelledById");
275 
276  b.Property<string>("Description")
277  .IsRequired();
278 
279  b.Property<string>("ExceptionDetails");
280 
281  b.Property<long>("InstanceId");
282 
283  b.Property<DateTimeOffset?>("StartedAt")
284  .IsRequired();
285 
286  b.Property<long>("StartedById");
287 
288  b.Property<DateTimeOffset?>("StoppedAt");
289 
290  b.HasKey("Id");
291 
292  b.HasIndex("CancelledById");
293 
294  b.HasIndex("InstanceId");
295 
296  b.HasIndex("StartedById");
297 
298  b.ToTable("Jobs");
299  });
300 
301  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
302  {
303  b.Property<long>("Id")
304  .ValueGeneratedOnAdd()
305  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
306 
307  b.Property<string>("AccessIdentifier")
308  .IsRequired();
309 
310  b.Property<string>("ChatChannelsJson")
311  .IsRequired();
312 
313  b.Property<string>("ChatCommandsJson")
314  .IsRequired();
315 
316  b.Property<long>("CompileJobId");
317 
318  b.Property<bool>("IsPrimary");
319 
320  b.Property<int>("Port");
321 
322  b.Property<int>("ProcessId");
323 
324  b.Property<int>("RebootState");
325 
326  b.Property<string>("ServerCommandsJson")
327  .IsRequired();
328 
329  b.HasKey("Id");
330 
331  b.HasIndex("CompileJobId");
332 
333  b.ToTable("ReattachInformations");
334  });
335 
336  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
337  {
338  b.Property<long>("Id")
339  .ValueGeneratedOnAdd()
340  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
341 
342  b.Property<string>("AccessToken");
343 
344  b.Property<string>("AccessUser");
345 
346  b.Property<bool?>("AutoUpdatesKeepTestMerges")
347  .IsRequired();
348 
349  b.Property<bool?>("AutoUpdatesSynchronize")
350  .IsRequired();
351 
352  b.Property<string>("CommitterEmail")
353  .IsRequired();
354 
355  b.Property<string>("CommitterName")
356  .IsRequired();
357 
358  b.Property<long>("InstanceId");
359 
360  b.Property<bool?>("PostTestMergeComment")
361  .IsRequired();
362 
363  b.Property<bool?>("PushTestMergeCommits")
364  .IsRequired();
365 
366  b.Property<bool?>("ShowTestMergeCommitters")
367  .IsRequired();
368 
369  b.HasKey("Id");
370 
371  b.HasIndex("InstanceId")
372  .IsUnique();
373 
374  b.ToTable("RepositorySettings");
375  });
376 
377  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
378  {
379  b.Property<long>("Id")
380  .ValueGeneratedOnAdd()
381  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
382 
383  b.Property<long>("RevisionInformationId");
384 
385  b.Property<long>("TestMergeId");
386 
387  b.HasKey("Id");
388 
389  b.HasIndex("RevisionInformationId");
390 
391  b.HasIndex("TestMergeId");
392 
393  b.ToTable("RevInfoTestMerges");
394  });
395 
396  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
397  {
398  b.Property<long>("Id")
399  .ValueGeneratedOnAdd()
400  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
401 
402  b.Property<string>("CommitSha")
403  .IsRequired()
404  .HasMaxLength(40);
405 
406  b.Property<long>("InstanceId");
407 
408  b.Property<string>("OriginCommitSha")
409  .IsRequired()
410  .HasMaxLength(40);
411 
412  b.HasKey("Id");
413 
414  b.HasIndex("CommitSha")
415  .IsUnique();
416 
417  b.HasIndex("InstanceId");
418 
419  b.ToTable("RevisionInformations");
420  });
421 
422  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
423  {
424  b.Property<long>("Id")
425  .ValueGeneratedOnAdd()
426  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
427 
428  b.Property<string>("Author")
429  .IsRequired();
430 
431  b.Property<string>("BodyAtMerge")
432  .IsRequired();
433 
434  b.Property<string>("Comment");
435 
436  b.Property<DateTimeOffset>("MergedAt");
437 
438  b.Property<long>("MergedById");
439 
440  b.Property<int?>("Number")
441  .IsRequired();
442 
443  b.Property<long?>("PrimaryRevisionInformationId")
444  .IsRequired();
445 
446  b.Property<string>("PullRequestRevision")
447  .IsRequired();
448 
449  b.Property<string>("TitleAtMerge")
450  .IsRequired();
451 
452  b.Property<string>("Url")
453  .IsRequired();
454 
455  b.HasKey("Id");
456 
457  b.HasIndex("MergedById");
458 
459  b.HasIndex("PrimaryRevisionInformationId")
460  .IsUnique();
461 
462  b.ToTable("TestMerges");
463  });
464 
465  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
466  {
467  b.Property<long>("Id")
468  .ValueGeneratedOnAdd()
469  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
470 
471  b.Property<decimal>("AdministrationRights")
472  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
473 
474  b.Property<string>("CanonicalName")
475  .IsRequired();
476 
477  b.Property<DateTimeOffset?>("CreatedAt")
478  .IsRequired();
479 
480  b.Property<long?>("CreatedById");
481 
482  b.Property<bool?>("Enabled")
483  .IsRequired();
484 
485  b.Property<decimal>("InstanceManagerRights")
486  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
487 
488  b.Property<DateTimeOffset?>("LastPasswordUpdate");
489 
490  b.Property<string>("Name")
491  .IsRequired();
492 
493  b.Property<string>("PasswordHash");
494 
495  b.Property<string>("SystemIdentifier");
496 
497  b.HasKey("Id");
498 
499  b.HasIndex("CanonicalName")
500  .IsUnique();
501 
502  b.HasIndex("CreatedById");
503 
504  b.ToTable("Users");
505  });
506 
507  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
508  {
509  b.Property<long>("Id")
510  .ValueGeneratedOnAdd()
511  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
512 
513  b.Property<long?>("AlphaId");
514 
515  b.Property<bool>("AlphaIsActive");
516 
517  b.Property<long?>("BravoId");
518 
519  b.Property<long>("InstanceId");
520 
521  b.HasKey("Id");
522 
523  b.HasIndex("AlphaId");
524 
525  b.HasIndex("BravoId");
526 
527  b.HasIndex("InstanceId")
528  .IsUnique();
529 
530  b.ToTable("WatchdogReattachInformations");
531  });
532 
533  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
534  {
535  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
536  .WithMany("ChatSettings")
537  .HasForeignKey("InstanceId")
538  .OnDelete(DeleteBehavior.Cascade);
539  });
540 
541  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
542  {
543  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
544  .WithMany("Channels")
545  .HasForeignKey("ChatSettingsId")
546  .OnDelete(DeleteBehavior.Cascade);
547  });
548 
549  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
550  {
551  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
552  .WithOne()
553  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
554  .OnDelete(DeleteBehavior.Restrict);
555 
556  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
557  .WithMany("CompileJobs")
558  .HasForeignKey("RevisionInformationId")
559  .OnDelete(DeleteBehavior.Cascade);
560  });
561 
562  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
563  {
564  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
565  .WithOne("DreamDaemonSettings")
566  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
567  .OnDelete(DeleteBehavior.Cascade);
568  });
569 
570  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
571  {
572  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
573  .WithOne("DreamMakerSettings")
574  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
575  .OnDelete(DeleteBehavior.Cascade);
576  });
577 
578  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
579  {
580  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
581  .WithMany("InstanceUsers")
582  .HasForeignKey("InstanceId")
583  .OnDelete(DeleteBehavior.Cascade);
584 
585  b.HasOne("Tgstation.Server.Host.Models.User")
586  .WithMany("InstanceUsers")
587  .HasForeignKey("UserId")
588  .OnDelete(DeleteBehavior.Cascade);
589  });
590 
591  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
592  {
593  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
594  .WithMany()
595  .HasForeignKey("CancelledById");
596 
597  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
598  .WithMany("Jobs")
599  .HasForeignKey("InstanceId")
600  .OnDelete(DeleteBehavior.Cascade);
601 
602  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
603  .WithMany()
604  .HasForeignKey("StartedById")
605  .OnDelete(DeleteBehavior.Cascade);
606  });
607 
608  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
609  {
610  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
611  .WithMany()
612  .HasForeignKey("CompileJobId")
613  .OnDelete(DeleteBehavior.Cascade);
614  });
615 
616  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
617  {
618  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
619  .WithOne("RepositorySettings")
620  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
621  .OnDelete(DeleteBehavior.Cascade);
622  });
623 
624  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
625  {
626  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
627  .WithMany("ActiveTestMerges")
628  .HasForeignKey("RevisionInformationId")
629  .OnDelete(DeleteBehavior.Cascade);
630 
631  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
632  .WithMany("RevisonInformations")
633  .HasForeignKey("TestMergeId")
634  .OnDelete(DeleteBehavior.Cascade);
635  });
636 
637  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
638  {
639  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
640  .WithMany("RevisionInformations")
641  .HasForeignKey("InstanceId")
642  .OnDelete(DeleteBehavior.Cascade);
643  });
644 
645  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
646  {
647  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
648  .WithMany("TestMerges")
649  .HasForeignKey("MergedById")
650  .OnDelete(DeleteBehavior.Restrict);
651 
652  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
653  .WithOne("PrimaryTestMerge")
654  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
655  .OnDelete(DeleteBehavior.Restrict);
656  });
657 
658  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
659  {
660  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
661  .WithMany("CreatedUsers")
662  .HasForeignKey("CreatedById");
663  });
664 
665  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
666  {
667  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
668  .WithMany()
669  .HasForeignKey("AlphaId");
670 
671  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
672  .WithMany()
673  .HasForeignKey("BravoId");
674 
675  b.HasOne("Tgstation.Server.Host.Models.Instance")
676  .WithOne("WatchdogReattachInformation")
677  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
678  .OnDelete(DeleteBehavior.Cascade);
679  });
680 #pragma warning restore 612, 618
681  }
682  }
683 }
-
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
- -
DatabaseContext<TParentContext> for Sqlserver
- - - +
diff --git a/20181124231534___m_s_toggle_testmerge_comments_8cs_source.html b/20181124231534___m_s_toggle_testmerge_comments_8cs_source.html index 05f21b5c07..0bcdf71cf6 100644 --- a/20181124231534___m_s_toggle_testmerge_comments_8cs_source.html +++ b/20181124231534___m_s_toggle_testmerge_comments_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20181124231534_MSToggleTestmergeComments.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20181124231534_MSToggleTestmergeComments.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,11 +71,11 @@ $(function() {
20181124231534_MSToggleTestmergeComments.cs
-Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MSToggleTestmergeComments : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.AddColumn<bool>(
21  name: "PostTestMergeComment",
22  table: "RepositorySettings",
23  nullable: false,
24  defaultValue: true);
25  }
26 
31  protected override void Down(MigrationBuilder migrationBuilder)
32  {
33  if (migrationBuilder == null)
34  throw new ArgumentNullException(nameof(migrationBuilder));
35 
36  migrationBuilder.DropColumn(
37  name: "PostTestMergeComment",
38  table: "RepositorySettings");
39  }
40  }
41 }
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
-
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
- - -
Add the Api.Models.Internal.RepositorySettings.PostTestMergeComment column for MSSQL
+Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MSToggleTestmergeComments : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.AddColumn<bool>(
21  name: "PostTestMergeComment",
22  table: "RepositorySettings",
23  nullable: false,
24  defaultValue: true);
25  }
26 
31  protected override void Down(MigrationBuilder migrationBuilder)
32  {
33  if (migrationBuilder == null)
34  throw new ArgumentNullException(nameof(migrationBuilder));
35 
36  migrationBuilder.DropColumn(
37  name: "PostTestMergeComment",
38  table: "RepositorySettings");
39  }
40  }
41 }
+
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
+
Add the Api.Models.Internal.RepositorySettings.PostTestMergeComment column for MSSQL
+
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
+
diff --git a/20181124231549___m_y_toggle_testmerge_comments_8_designer_8cs_source.html b/20181124231549___m_y_toggle_testmerge_comments_8_designer_8cs_source.html index f4ca52f72d..f8ebcb5824 100644 --- a/20181124231549___m_y_toggle_testmerge_comments_8_designer_8cs_source.html +++ b/20181124231549___m_y_toggle_testmerge_comments_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20181124231549_MYToggleTestmergeComments.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20181124231549_MYToggleTestmergeComments.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20181124231549_MYToggleTestmergeComments.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
7 
9 {
11  [Migration("20181124231549_MYToggleTestmergeComments")]
12  partial class MYToggleTestmergeComments
13  {
18  protected override void BuildTargetModel(ModelBuilder modelBuilder)
19  {
20 #pragma warning disable 612, 618
21  modelBuilder
22  .HasAnnotation("ProductVersion", "2.1.4-rtm-31024")
23  .HasAnnotation("Relational:MaxIdentifierLength", 64);
24 
25  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
26  {
27  b.Property<long>("Id")
28  .ValueGeneratedOnAdd();
29 
30  b.Property<string>("ConnectionString")
31  .IsRequired();
32 
33  b.Property<bool?>("Enabled");
34 
35  b.Property<long>("InstanceId");
36 
37  b.Property<string>("Name")
38  .IsRequired();
39 
40  b.Property<int?>("Provider");
41 
42  b.HasKey("Id");
43 
44  b.HasIndex("InstanceId");
45 
46  b.HasIndex("Name")
47  .IsUnique();
48 
49  b.ToTable("ChatBots");
50  });
51 
52  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
53  {
54  b.Property<long>("Id")
55  .ValueGeneratedOnAdd();
56 
57  b.Property<long>("ChatSettingsId");
58 
59  b.Property<ulong?>("DiscordChannelId");
60 
61  b.Property<string>("IrcChannel");
62 
63  b.Property<bool?>("IsAdminChannel")
64  .IsRequired();
65 
66  b.Property<bool?>("IsUpdatesChannel")
67  .IsRequired();
68 
69  b.Property<bool?>("IsWatchdogChannel")
70  .IsRequired();
71 
72  b.Property<string>("Tag");
73 
74  b.HasKey("Id");
75 
76  b.HasIndex("ChatSettingsId", "DiscordChannelId")
77  .IsUnique();
78 
79  b.HasIndex("ChatSettingsId", "IrcChannel")
80  .IsUnique();
81 
82  b.ToTable("ChatChannels");
83  });
84 
85  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
86  {
87  b.Property<long>("Id")
88  .ValueGeneratedOnAdd();
89 
90  b.Property<string>("ByondVersion")
91  .IsRequired();
92 
93  b.Property<Guid?>("DirectoryName")
94  .IsRequired();
95 
96  b.Property<string>("DmeName")
97  .IsRequired();
98 
99  b.Property<long>("JobId");
100 
101  b.Property<int>("MinimumSecurityLevel");
102 
103  b.Property<string>("Output")
104  .IsRequired();
105 
106  b.Property<long>("RevisionInformationId");
107 
108  b.HasKey("Id");
109 
110  b.HasIndex("DirectoryName");
111 
112  b.HasIndex("JobId")
113  .IsUnique();
114 
115  b.HasIndex("RevisionInformationId");
116 
117  b.ToTable("CompileJobs");
118  });
119 
120  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
121  {
122  b.Property<long>("Id")
123  .ValueGeneratedOnAdd();
124 
125  b.Property<string>("AccessToken");
126 
127  b.Property<bool?>("AllowWebClient")
128  .IsRequired();
129 
130  b.Property<bool?>("AutoStart")
131  .IsRequired();
132 
133  b.Property<long>("InstanceId");
134 
135  b.Property<ushort?>("PrimaryPort")
136  .IsRequired();
137 
138  b.Property<int?>("ProcessId");
139 
140  b.Property<ushort?>("SecondaryPort")
141  .IsRequired();
142 
143  b.Property<int>("SecurityLevel");
144 
145  b.Property<bool?>("SoftRestart")
146  .IsRequired();
147 
148  b.Property<bool?>("SoftShutdown")
149  .IsRequired();
150 
151  b.Property<uint?>("StartupTimeout")
152  .IsRequired();
153 
154  b.HasKey("Id");
155 
156  b.HasIndex("InstanceId")
157  .IsUnique();
158 
159  b.ToTable("DreamDaemonSettings");
160  });
161 
162  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
163  {
164  b.Property<long>("Id")
165  .ValueGeneratedOnAdd();
166 
167  b.Property<ushort?>("ApiValidationPort")
168  .IsRequired();
169 
170  b.Property<int>("ApiValidationSecurityLevel");
171 
172  b.Property<long>("InstanceId");
173 
174  b.Property<string>("ProjectName");
175 
176  b.HasKey("Id");
177 
178  b.HasIndex("InstanceId")
179  .IsUnique();
180 
181  b.ToTable("DreamMakerSettings");
182  });
183 
184  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
185  {
186  b.Property<long>("Id")
187  .ValueGeneratedOnAdd();
188 
189  b.Property<uint?>("AutoUpdateInterval")
190  .IsRequired();
191 
192  b.Property<int>("ConfigurationType");
193 
194  b.Property<string>("Name")
195  .IsRequired();
196 
197  b.Property<bool?>("Online")
198  .IsRequired();
199 
200  b.Property<string>("Path")
201  .IsRequired();
202 
203  b.HasKey("Id");
204 
205  b.HasIndex("Path")
206  .IsUnique();
207 
208  b.ToTable("Instances");
209  });
210 
211  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
212  {
213  b.Property<long>("Id")
214  .ValueGeneratedOnAdd();
215 
216  b.Property<ulong>("ByondRights");
217 
218  b.Property<ulong>("ChatBotRights");
219 
220  b.Property<ulong>("ConfigurationRights");
221 
222  b.Property<ulong>("DreamDaemonRights");
223 
224  b.Property<ulong>("DreamMakerRights");
225 
226  b.Property<long>("InstanceId");
227 
228  b.Property<ulong>("InstanceUserRights");
229 
230  b.Property<ulong>("RepositoryRights");
231 
232  b.Property<long?>("UserId")
233  .IsRequired();
234 
235  b.HasKey("Id");
236 
237  b.HasIndex("InstanceId");
238 
239  b.HasIndex("UserId", "InstanceId")
240  .IsUnique();
241 
242  b.ToTable("InstanceUsers");
243  });
244 
245  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
246  {
247  b.Property<long>("Id")
248  .ValueGeneratedOnAdd();
249 
250  b.Property<ulong?>("CancelRight");
251 
252  b.Property<ulong?>("CancelRightsType");
253 
254  b.Property<bool?>("Cancelled")
255  .IsRequired();
256 
257  b.Property<long?>("CancelledById");
258 
259  b.Property<string>("Description")
260  .IsRequired();
261 
262  b.Property<string>("ExceptionDetails");
263 
264  b.Property<long>("InstanceId");
265 
266  b.Property<DateTimeOffset?>("StartedAt")
267  .IsRequired();
268 
269  b.Property<long>("StartedById");
270 
271  b.Property<DateTimeOffset?>("StoppedAt");
272 
273  b.HasKey("Id");
274 
275  b.HasIndex("CancelledById");
276 
277  b.HasIndex("InstanceId");
278 
279  b.HasIndex("StartedById");
280 
281  b.ToTable("Jobs");
282  });
283 
284  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
285  {
286  b.Property<long>("Id")
287  .ValueGeneratedOnAdd();
288 
289  b.Property<string>("AccessIdentifier")
290  .IsRequired();
291 
292  b.Property<string>("ChatChannelsJson")
293  .IsRequired();
294 
295  b.Property<string>("ChatCommandsJson")
296  .IsRequired();
297 
298  b.Property<long>("CompileJobId");
299 
300  b.Property<bool>("IsPrimary");
301 
302  b.Property<ushort>("Port");
303 
304  b.Property<int>("ProcessId");
305 
306  b.Property<int>("RebootState");
307 
308  b.Property<string>("ServerCommandsJson")
309  .IsRequired();
310 
311  b.HasKey("Id");
312 
313  b.HasIndex("CompileJobId");
314 
315  b.ToTable("ReattachInformations");
316  });
317 
318  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
319  {
320  b.Property<long>("Id")
321  .ValueGeneratedOnAdd();
322 
323  b.Property<string>("AccessToken");
324 
325  b.Property<string>("AccessUser");
326 
327  b.Property<bool?>("AutoUpdatesKeepTestMerges")
328  .IsRequired();
329 
330  b.Property<bool?>("AutoUpdatesSynchronize")
331  .IsRequired();
332 
333  b.Property<string>("CommitterEmail")
334  .IsRequired();
335 
336  b.Property<string>("CommitterName")
337  .IsRequired();
338 
339  b.Property<long>("InstanceId");
340 
341  b.Property<bool?>("PostTestMergeComment")
342  .IsRequired();
343 
344  b.Property<bool?>("PushTestMergeCommits")
345  .IsRequired();
346 
347  b.Property<bool?>("ShowTestMergeCommitters")
348  .IsRequired();
349 
350  b.HasKey("Id");
351 
352  b.HasIndex("InstanceId")
353  .IsUnique();
354 
355  b.ToTable("RepositorySettings");
356  });
357 
358  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
359  {
360  b.Property<long>("Id")
361  .ValueGeneratedOnAdd();
362 
363  b.Property<long>("RevisionInformationId");
364 
365  b.Property<long>("TestMergeId");
366 
367  b.HasKey("Id");
368 
369  b.HasIndex("RevisionInformationId");
370 
371  b.HasIndex("TestMergeId");
372 
373  b.ToTable("RevInfoTestMerges");
374  });
375 
376  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
377  {
378  b.Property<long>("Id")
379  .ValueGeneratedOnAdd();
380 
381  b.Property<string>("CommitSha")
382  .IsRequired()
383  .HasMaxLength(40);
384 
385  b.Property<long>("InstanceId");
386 
387  b.Property<string>("OriginCommitSha")
388  .IsRequired()
389  .HasMaxLength(40);
390 
391  b.HasKey("Id");
392 
393  b.HasIndex("CommitSha")
394  .IsUnique();
395 
396  b.HasIndex("InstanceId");
397 
398  b.ToTable("RevisionInformations");
399  });
400 
401  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
402  {
403  b.Property<long>("Id")
404  .ValueGeneratedOnAdd();
405 
406  b.Property<string>("Author")
407  .IsRequired();
408 
409  b.Property<string>("BodyAtMerge")
410  .IsRequired();
411 
412  b.Property<string>("Comment");
413 
414  b.Property<DateTimeOffset>("MergedAt");
415 
416  b.Property<long>("MergedById");
417 
418  b.Property<int?>("Number")
419  .IsRequired();
420 
421  b.Property<long?>("PrimaryRevisionInformationId")
422  .IsRequired();
423 
424  b.Property<string>("PullRequestRevision")
425  .IsRequired();
426 
427  b.Property<string>("TitleAtMerge")
428  .IsRequired();
429 
430  b.Property<string>("Url")
431  .IsRequired();
432 
433  b.HasKey("Id");
434 
435  b.HasIndex("MergedById");
436 
437  b.HasIndex("PrimaryRevisionInformationId")
438  .IsUnique();
439 
440  b.ToTable("TestMerges");
441  });
442 
443  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
444  {
445  b.Property<long>("Id")
446  .ValueGeneratedOnAdd();
447 
448  b.Property<ulong>("AdministrationRights");
449 
450  b.Property<string>("CanonicalName")
451  .IsRequired();
452 
453  b.Property<DateTimeOffset?>("CreatedAt")
454  .IsRequired();
455 
456  b.Property<long?>("CreatedById");
457 
458  b.Property<bool?>("Enabled")
459  .IsRequired();
460 
461  b.Property<ulong>("InstanceManagerRights");
462 
463  b.Property<DateTimeOffset?>("LastPasswordUpdate");
464 
465  b.Property<string>("Name")
466  .IsRequired();
467 
468  b.Property<string>("PasswordHash");
469 
470  b.Property<string>("SystemIdentifier");
471 
472  b.HasKey("Id");
473 
474  b.HasIndex("CanonicalName")
475  .IsUnique();
476 
477  b.HasIndex("CreatedById");
478 
479  b.ToTable("Users");
480  });
481 
482  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
483  {
484  b.Property<long>("Id")
485  .ValueGeneratedOnAdd();
486 
487  b.Property<long?>("AlphaId");
488 
489  b.Property<bool>("AlphaIsActive");
490 
491  b.Property<long?>("BravoId");
492 
493  b.Property<long>("InstanceId");
494 
495  b.HasKey("Id");
496 
497  b.HasIndex("AlphaId");
498 
499  b.HasIndex("BravoId");
500 
501  b.HasIndex("InstanceId")
502  .IsUnique();
503 
504  b.ToTable("WatchdogReattachInformations");
505  });
506 
507  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
508  {
509  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
510  .WithMany("ChatSettings")
511  .HasForeignKey("InstanceId")
512  .OnDelete(DeleteBehavior.Cascade);
513  });
514 
515  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
516  {
517  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
518  .WithMany("Channels")
519  .HasForeignKey("ChatSettingsId")
520  .OnDelete(DeleteBehavior.Cascade);
521  });
522 
523  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
524  {
525  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
526  .WithOne()
527  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
528  .OnDelete(DeleteBehavior.Restrict);
529 
530  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
531  .WithMany("CompileJobs")
532  .HasForeignKey("RevisionInformationId")
533  .OnDelete(DeleteBehavior.Cascade);
534  });
535 
536  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
537  {
538  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
539  .WithOne("DreamDaemonSettings")
540  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
541  .OnDelete(DeleteBehavior.Cascade);
542  });
543 
544  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
545  {
546  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
547  .WithOne("DreamMakerSettings")
548  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
549  .OnDelete(DeleteBehavior.Cascade);
550  });
551 
552  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
553  {
554  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
555  .WithMany("InstanceUsers")
556  .HasForeignKey("InstanceId")
557  .OnDelete(DeleteBehavior.Cascade);
558 
559  b.HasOne("Tgstation.Server.Host.Models.User")
560  .WithMany("InstanceUsers")
561  .HasForeignKey("UserId")
562  .OnDelete(DeleteBehavior.Cascade);
563  });
564 
565  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
566  {
567  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
568  .WithMany()
569  .HasForeignKey("CancelledById");
570 
571  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
572  .WithMany("Jobs")
573  .HasForeignKey("InstanceId")
574  .OnDelete(DeleteBehavior.Cascade);
575 
576  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
577  .WithMany()
578  .HasForeignKey("StartedById")
579  .OnDelete(DeleteBehavior.Cascade);
580  });
581 
582  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
583  {
584  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
585  .WithMany()
586  .HasForeignKey("CompileJobId")
587  .OnDelete(DeleteBehavior.Cascade);
588  });
589 
590  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
591  {
592  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
593  .WithOne("RepositorySettings")
594  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
595  .OnDelete(DeleteBehavior.Cascade);
596  });
597 
598  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
599  {
600  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
601  .WithMany("ActiveTestMerges")
602  .HasForeignKey("RevisionInformationId")
603  .OnDelete(DeleteBehavior.Cascade);
604 
605  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
606  .WithMany("RevisonInformations")
607  .HasForeignKey("TestMergeId")
608  .OnDelete(DeleteBehavior.Cascade);
609  });
610 
611  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
612  {
613  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
614  .WithMany("RevisionInformations")
615  .HasForeignKey("InstanceId")
616  .OnDelete(DeleteBehavior.Cascade);
617  });
618 
619  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
620  {
621  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
622  .WithMany("TestMerges")
623  .HasForeignKey("MergedById")
624  .OnDelete(DeleteBehavior.Restrict);
625 
626  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
627  .WithOne("PrimaryTestMerge")
628  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
629  .OnDelete(DeleteBehavior.Restrict);
630  });
631 
632  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
633  {
634  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
635  .WithMany("CreatedUsers")
636  .HasForeignKey("CreatedById");
637  });
638 
639  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
640  {
641  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
642  .WithMany()
643  .HasForeignKey("AlphaId");
644 
645  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
646  .WithMany()
647  .HasForeignKey("BravoId");
648 
649  b.HasOne("Tgstation.Server.Host.Models.Instance")
650  .WithOne("WatchdogReattachInformation")
651  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
652  .OnDelete(DeleteBehavior.Cascade);
653  });
654 #pragma warning restore 612, 618
655  }
656  }
657 }
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
- - +Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
6 
8 {
9  [DbContext(typeof(MySqlDatabaseContext))]
10  [Migration("20181124231549_MYToggleTestmergeComments")]
11  partial class MYToggleTestmergeComments
12  {
17  protected override void BuildTargetModel(ModelBuilder modelBuilder)
18  {
19 #pragma warning disable 612, 618
20  modelBuilder
21  .HasAnnotation("ProductVersion", "2.1.4-rtm-31024")
22  .HasAnnotation("Relational:MaxIdentifierLength", 64);
23 
24  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
25  {
26  b.Property<long>("Id")
27  .ValueGeneratedOnAdd();
28 
29  b.Property<string>("ConnectionString")
30  .IsRequired();
31 
32  b.Property<bool?>("Enabled");
33 
34  b.Property<long>("InstanceId");
35 
36  b.Property<string>("Name")
37  .IsRequired();
38 
39  b.Property<int?>("Provider");
40 
41  b.HasKey("Id");
42 
43  b.HasIndex("InstanceId");
44 
45  b.HasIndex("Name")
46  .IsUnique();
47 
48  b.ToTable("ChatBots");
49  });
50 
51  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
52  {
53  b.Property<long>("Id")
54  .ValueGeneratedOnAdd();
55 
56  b.Property<long>("ChatSettingsId");
57 
58  b.Property<ulong?>("DiscordChannelId");
59 
60  b.Property<string>("IrcChannel");
61 
62  b.Property<bool?>("IsAdminChannel")
63  .IsRequired();
64 
65  b.Property<bool?>("IsUpdatesChannel")
66  .IsRequired();
67 
68  b.Property<bool?>("IsWatchdogChannel")
69  .IsRequired();
70 
71  b.Property<string>("Tag");
72 
73  b.HasKey("Id");
74 
75  b.HasIndex("ChatSettingsId", "DiscordChannelId")
76  .IsUnique();
77 
78  b.HasIndex("ChatSettingsId", "IrcChannel")
79  .IsUnique();
80 
81  b.ToTable("ChatChannels");
82  });
83 
84  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
85  {
86  b.Property<long>("Id")
87  .ValueGeneratedOnAdd();
88 
89  b.Property<string>("ByondVersion")
90  .IsRequired();
91 
92  b.Property<Guid?>("DirectoryName")
93  .IsRequired();
94 
95  b.Property<string>("DmeName")
96  .IsRequired();
97 
98  b.Property<long>("JobId");
99 
100  b.Property<int>("MinimumSecurityLevel");
101 
102  b.Property<string>("Output")
103  .IsRequired();
104 
105  b.Property<long>("RevisionInformationId");
106 
107  b.HasKey("Id");
108 
109  b.HasIndex("DirectoryName");
110 
111  b.HasIndex("JobId")
112  .IsUnique();
113 
114  b.HasIndex("RevisionInformationId");
115 
116  b.ToTable("CompileJobs");
117  });
118 
119  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
120  {
121  b.Property<long>("Id")
122  .ValueGeneratedOnAdd();
123 
124  b.Property<string>("AccessToken");
125 
126  b.Property<bool?>("AllowWebClient")
127  .IsRequired();
128 
129  b.Property<bool?>("AutoStart")
130  .IsRequired();
131 
132  b.Property<long>("InstanceId");
133 
134  b.Property<ushort?>("PrimaryPort")
135  .IsRequired();
136 
137  b.Property<int?>("ProcessId");
138 
139  b.Property<ushort?>("SecondaryPort")
140  .IsRequired();
141 
142  b.Property<int>("SecurityLevel");
143 
144  b.Property<bool?>("SoftRestart")
145  .IsRequired();
146 
147  b.Property<bool?>("SoftShutdown")
148  .IsRequired();
149 
150  b.Property<uint?>("StartupTimeout")
151  .IsRequired();
152 
153  b.HasKey("Id");
154 
155  b.HasIndex("InstanceId")
156  .IsUnique();
157 
158  b.ToTable("DreamDaemonSettings");
159  });
160 
161  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
162  {
163  b.Property<long>("Id")
164  .ValueGeneratedOnAdd();
165 
166  b.Property<ushort?>("ApiValidationPort")
167  .IsRequired();
168 
169  b.Property<int>("ApiValidationSecurityLevel");
170 
171  b.Property<long>("InstanceId");
172 
173  b.Property<string>("ProjectName");
174 
175  b.HasKey("Id");
176 
177  b.HasIndex("InstanceId")
178  .IsUnique();
179 
180  b.ToTable("DreamMakerSettings");
181  });
182 
183  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
184  {
185  b.Property<long>("Id")
186  .ValueGeneratedOnAdd();
187 
188  b.Property<uint?>("AutoUpdateInterval")
189  .IsRequired();
190 
191  b.Property<int>("ConfigurationType");
192 
193  b.Property<string>("Name")
194  .IsRequired();
195 
196  b.Property<bool?>("Online")
197  .IsRequired();
198 
199  b.Property<string>("Path")
200  .IsRequired();
201 
202  b.HasKey("Id");
203 
204  b.HasIndex("Path")
205  .IsUnique();
206 
207  b.ToTable("Instances");
208  });
209 
210  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
211  {
212  b.Property<long>("Id")
213  .ValueGeneratedOnAdd();
214 
215  b.Property<ulong>("ByondRights");
216 
217  b.Property<ulong>("ChatBotRights");
218 
219  b.Property<ulong>("ConfigurationRights");
220 
221  b.Property<ulong>("DreamDaemonRights");
222 
223  b.Property<ulong>("DreamMakerRights");
224 
225  b.Property<long>("InstanceId");
226 
227  b.Property<ulong>("InstanceUserRights");
228 
229  b.Property<ulong>("RepositoryRights");
230 
231  b.Property<long?>("UserId")
232  .IsRequired();
233 
234  b.HasKey("Id");
235 
236  b.HasIndex("InstanceId");
237 
238  b.HasIndex("UserId", "InstanceId")
239  .IsUnique();
240 
241  b.ToTable("InstanceUsers");
242  });
243 
244  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
245  {
246  b.Property<long>("Id")
247  .ValueGeneratedOnAdd();
248 
249  b.Property<ulong?>("CancelRight");
250 
251  b.Property<ulong?>("CancelRightsType");
252 
253  b.Property<bool?>("Cancelled")
254  .IsRequired();
255 
256  b.Property<long?>("CancelledById");
257 
258  b.Property<string>("Description")
259  .IsRequired();
260 
261  b.Property<string>("ExceptionDetails");
262 
263  b.Property<long>("InstanceId");
264 
265  b.Property<DateTimeOffset?>("StartedAt")
266  .IsRequired();
267 
268  b.Property<long>("StartedById");
269 
270  b.Property<DateTimeOffset?>("StoppedAt");
271 
272  b.HasKey("Id");
273 
274  b.HasIndex("CancelledById");
275 
276  b.HasIndex("InstanceId");
277 
278  b.HasIndex("StartedById");
279 
280  b.ToTable("Jobs");
281  });
282 
283  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
284  {
285  b.Property<long>("Id")
286  .ValueGeneratedOnAdd();
287 
288  b.Property<string>("AccessIdentifier")
289  .IsRequired();
290 
291  b.Property<string>("ChatChannelsJson")
292  .IsRequired();
293 
294  b.Property<string>("ChatCommandsJson")
295  .IsRequired();
296 
297  b.Property<long>("CompileJobId");
298 
299  b.Property<bool>("IsPrimary");
300 
301  b.Property<ushort>("Port");
302 
303  b.Property<int>("ProcessId");
304 
305  b.Property<int>("RebootState");
306 
307  b.Property<string>("ServerCommandsJson")
308  .IsRequired();
309 
310  b.HasKey("Id");
311 
312  b.HasIndex("CompileJobId");
313 
314  b.ToTable("ReattachInformations");
315  });
316 
317  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
318  {
319  b.Property<long>("Id")
320  .ValueGeneratedOnAdd();
321 
322  b.Property<string>("AccessToken");
323 
324  b.Property<string>("AccessUser");
325 
326  b.Property<bool?>("AutoUpdatesKeepTestMerges")
327  .IsRequired();
328 
329  b.Property<bool?>("AutoUpdatesSynchronize")
330  .IsRequired();
331 
332  b.Property<string>("CommitterEmail")
333  .IsRequired();
334 
335  b.Property<string>("CommitterName")
336  .IsRequired();
337 
338  b.Property<long>("InstanceId");
339 
340  b.Property<bool?>("PostTestMergeComment")
341  .IsRequired();
342 
343  b.Property<bool?>("PushTestMergeCommits")
344  .IsRequired();
345 
346  b.Property<bool?>("ShowTestMergeCommitters")
347  .IsRequired();
348 
349  b.HasKey("Id");
350 
351  b.HasIndex("InstanceId")
352  .IsUnique();
353 
354  b.ToTable("RepositorySettings");
355  });
356 
357  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
358  {
359  b.Property<long>("Id")
360  .ValueGeneratedOnAdd();
361 
362  b.Property<long>("RevisionInformationId");
363 
364  b.Property<long>("TestMergeId");
365 
366  b.HasKey("Id");
367 
368  b.HasIndex("RevisionInformationId");
369 
370  b.HasIndex("TestMergeId");
371 
372  b.ToTable("RevInfoTestMerges");
373  });
374 
375  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
376  {
377  b.Property<long>("Id")
378  .ValueGeneratedOnAdd();
379 
380  b.Property<string>("CommitSha")
381  .IsRequired()
382  .HasMaxLength(40);
383 
384  b.Property<long>("InstanceId");
385 
386  b.Property<string>("OriginCommitSha")
387  .IsRequired()
388  .HasMaxLength(40);
389 
390  b.HasKey("Id");
391 
392  b.HasIndex("CommitSha")
393  .IsUnique();
394 
395  b.HasIndex("InstanceId");
396 
397  b.ToTable("RevisionInformations");
398  });
399 
400  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
401  {
402  b.Property<long>("Id")
403  .ValueGeneratedOnAdd();
404 
405  b.Property<string>("Author")
406  .IsRequired();
407 
408  b.Property<string>("BodyAtMerge")
409  .IsRequired();
410 
411  b.Property<string>("Comment");
412 
413  b.Property<DateTimeOffset>("MergedAt");
414 
415  b.Property<long>("MergedById");
416 
417  b.Property<int?>("Number")
418  .IsRequired();
419 
420  b.Property<long?>("PrimaryRevisionInformationId")
421  .IsRequired();
422 
423  b.Property<string>("PullRequestRevision")
424  .IsRequired();
425 
426  b.Property<string>("TitleAtMerge")
427  .IsRequired();
428 
429  b.Property<string>("Url")
430  .IsRequired();
431 
432  b.HasKey("Id");
433 
434  b.HasIndex("MergedById");
435 
436  b.HasIndex("PrimaryRevisionInformationId")
437  .IsUnique();
438 
439  b.ToTable("TestMerges");
440  });
441 
442  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
443  {
444  b.Property<long>("Id")
445  .ValueGeneratedOnAdd();
446 
447  b.Property<ulong>("AdministrationRights");
448 
449  b.Property<string>("CanonicalName")
450  .IsRequired();
451 
452  b.Property<DateTimeOffset?>("CreatedAt")
453  .IsRequired();
454 
455  b.Property<long?>("CreatedById");
456 
457  b.Property<bool?>("Enabled")
458  .IsRequired();
459 
460  b.Property<ulong>("InstanceManagerRights");
461 
462  b.Property<DateTimeOffset?>("LastPasswordUpdate");
463 
464  b.Property<string>("Name")
465  .IsRequired();
466 
467  b.Property<string>("PasswordHash");
468 
469  b.Property<string>("SystemIdentifier");
470 
471  b.HasKey("Id");
472 
473  b.HasIndex("CanonicalName")
474  .IsUnique();
475 
476  b.HasIndex("CreatedById");
477 
478  b.ToTable("Users");
479  });
480 
481  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
482  {
483  b.Property<long>("Id")
484  .ValueGeneratedOnAdd();
485 
486  b.Property<long?>("AlphaId");
487 
488  b.Property<bool>("AlphaIsActive");
489 
490  b.Property<long?>("BravoId");
491 
492  b.Property<long>("InstanceId");
493 
494  b.HasKey("Id");
495 
496  b.HasIndex("AlphaId");
497 
498  b.HasIndex("BravoId");
499 
500  b.HasIndex("InstanceId")
501  .IsUnique();
502 
503  b.ToTable("WatchdogReattachInformations");
504  });
505 
506  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
507  {
508  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
509  .WithMany("ChatSettings")
510  .HasForeignKey("InstanceId")
511  .OnDelete(DeleteBehavior.Cascade);
512  });
513 
514  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
515  {
516  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
517  .WithMany("Channels")
518  .HasForeignKey("ChatSettingsId")
519  .OnDelete(DeleteBehavior.Cascade);
520  });
521 
522  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
523  {
524  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
525  .WithOne()
526  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
527  .OnDelete(DeleteBehavior.Restrict);
528 
529  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
530  .WithMany("CompileJobs")
531  .HasForeignKey("RevisionInformationId")
532  .OnDelete(DeleteBehavior.Cascade);
533  });
534 
535  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
536  {
537  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
538  .WithOne("DreamDaemonSettings")
539  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
540  .OnDelete(DeleteBehavior.Cascade);
541  });
542 
543  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
544  {
545  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
546  .WithOne("DreamMakerSettings")
547  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
548  .OnDelete(DeleteBehavior.Cascade);
549  });
550 
551  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
552  {
553  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
554  .WithMany("InstanceUsers")
555  .HasForeignKey("InstanceId")
556  .OnDelete(DeleteBehavior.Cascade);
557 
558  b.HasOne("Tgstation.Server.Host.Models.User")
559  .WithMany("InstanceUsers")
560  .HasForeignKey("UserId")
561  .OnDelete(DeleteBehavior.Cascade);
562  });
563 
564  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
565  {
566  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
567  .WithMany()
568  .HasForeignKey("CancelledById");
569 
570  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
571  .WithMany("Jobs")
572  .HasForeignKey("InstanceId")
573  .OnDelete(DeleteBehavior.Cascade);
574 
575  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
576  .WithMany()
577  .HasForeignKey("StartedById")
578  .OnDelete(DeleteBehavior.Cascade);
579  });
580 
581  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
582  {
583  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
584  .WithMany()
585  .HasForeignKey("CompileJobId")
586  .OnDelete(DeleteBehavior.Cascade);
587  });
588 
589  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
590  {
591  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
592  .WithOne("RepositorySettings")
593  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
594  .OnDelete(DeleteBehavior.Cascade);
595  });
596 
597  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
598  {
599  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
600  .WithMany("ActiveTestMerges")
601  .HasForeignKey("RevisionInformationId")
602  .OnDelete(DeleteBehavior.Cascade);
603 
604  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
605  .WithMany("RevisonInformations")
606  .HasForeignKey("TestMergeId")
607  .OnDelete(DeleteBehavior.Cascade);
608  });
609 
610  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
611  {
612  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
613  .WithMany("RevisionInformations")
614  .HasForeignKey("InstanceId")
615  .OnDelete(DeleteBehavior.Cascade);
616  });
617 
618  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
619  {
620  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
621  .WithMany("TestMerges")
622  .HasForeignKey("MergedById")
623  .OnDelete(DeleteBehavior.Restrict);
624 
625  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
626  .WithOne("PrimaryTestMerge")
627  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
628  .OnDelete(DeleteBehavior.Restrict);
629  });
630 
631  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
632  {
633  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
634  .WithMany("CreatedUsers")
635  .HasForeignKey("CreatedById");
636  });
637 
638  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
639  {
640  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
641  .WithMany()
642  .HasForeignKey("AlphaId");
643 
644  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
645  .WithMany()
646  .HasForeignKey("BravoId");
647 
648  b.HasOne("Tgstation.Server.Host.Models.Instance")
649  .WithOne("WatchdogReattachInformation")
650  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
651  .OnDelete(DeleteBehavior.Cascade);
652  });
653 #pragma warning restore 612, 618
654  }
655  }
656 }
+ -
DatabaseContext<TParentContext> for MySQL
- - - - +
diff --git a/20181124231549___m_y_toggle_testmerge_comments_8cs_source.html b/20181124231549___m_y_toggle_testmerge_comments_8cs_source.html index 29c3cd63ba..ffcbe37837 100644 --- a/20181124231549___m_y_toggle_testmerge_comments_8cs_source.html +++ b/20181124231549___m_y_toggle_testmerge_comments_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20181124231549_MYToggleTestmergeComments.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20181124231549_MYToggleTestmergeComments.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,11 +71,11 @@ $(function() {
20181124231549_MYToggleTestmergeComments.cs
-Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MYToggleTestmergeComments : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.AddColumn<bool>(
21  name: "PostTestMergeComment",
22  table: "RepositorySettings",
23  nullable: false,
24  defaultValue: true);
25  }
26 
31  protected override void Down(MigrationBuilder migrationBuilder)
32  {
33  if (migrationBuilder == null)
34  throw new ArgumentNullException(nameof(migrationBuilder));
35 
36  migrationBuilder.DropColumn(
37  name: "PostTestMergeComment",
38  table: "RepositorySettings");
39  }
40  }
41 }
+Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MYToggleTestmergeComments : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.AddColumn<bool>(
21  name: "PostTestMergeComment",
22  table: "RepositorySettings",
23  nullable: false,
24  defaultValue: true);
25  }
26 
31  protected override void Down(MigrationBuilder migrationBuilder)
32  {
33  if (migrationBuilder == null)
34  throw new ArgumentNullException(nameof(migrationBuilder));
35 
36  migrationBuilder.DropColumn(
37  name: "PostTestMergeComment",
38  table: "RepositorySettings");
39  }
40  }
41 }
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
-
Add the Api.Models.Internal.RepositorySettings.PostTestMergeComment column for MySQL/MariaDB
-
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
-
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
+
Add the Api.Models.Internal.RepositorySettings.PostTestMergeComment column for MySQL/MariaDB
+
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
+
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MSFixRevInfoIndex
 Make commit shas non-unique per Instance for MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MSFixRevInfoIndex
 Make commit shas non-unique per Instance for MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20190219041825___m_s_fix_rev_info_index_8_designer_8cs_source.html b/20190219041825___m_s_fix_rev_info_index_8_designer_8cs_source.html index eee02da698..8a2cf2df6e 100644 --- a/20190219041825___m_s_fix_rev_info_index_8_designer_8cs_source.html +++ b/20190219041825___m_s_fix_rev_info_index_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20190219041825_MSFixRevInfoIndex.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20190219041825_MSFixRevInfoIndex.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20190219041825_MSFixRevInfoIndex.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
9 
11 {
13  [Migration("20190219041825_MSFixRevInfoIndex")]
14  partial class MSFixRevInfoIndex
15  {
20  protected override void BuildTargetModel(ModelBuilder modelBuilder)
21  {
22 #pragma warning disable 612, 618
23  modelBuilder
24  .HasAnnotation("ProductVersion", "2.1.4-rtm-31024")
25  .HasAnnotation("Relational:MaxIdentifierLength", 128)
26  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
27 
28  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
29  {
30  b.Property<long>("Id")
31  .ValueGeneratedOnAdd()
32  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
33 
34  b.Property<string>("ConnectionString")
35  .IsRequired();
36 
37  b.Property<bool?>("Enabled");
38 
39  b.Property<long>("InstanceId");
40 
41  b.Property<string>("Name")
42  .IsRequired();
43 
44  b.Property<int?>("Provider");
45 
46  b.HasKey("Id");
47 
48  b.HasIndex("InstanceId");
49 
50  b.HasIndex("Name")
51  .IsUnique();
52 
53  b.ToTable("ChatBots");
54  });
55 
56  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
57  {
58  b.Property<long>("Id")
59  .ValueGeneratedOnAdd()
60  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
61 
62  b.Property<long>("ChatSettingsId");
63 
64  b.Property<decimal?>("DiscordChannelId")
65  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
66 
67  b.Property<string>("IrcChannel");
68 
69  b.Property<bool?>("IsAdminChannel")
70  .IsRequired();
71 
72  b.Property<bool?>("IsUpdatesChannel")
73  .IsRequired();
74 
75  b.Property<bool?>("IsWatchdogChannel")
76  .IsRequired();
77 
78  b.Property<string>("Tag");
79 
80  b.HasKey("Id");
81 
82  b.HasIndex("ChatSettingsId", "DiscordChannelId")
83  .IsUnique()
84  .HasFilter("[DiscordChannelId] IS NOT NULL");
85 
86  b.HasIndex("ChatSettingsId", "IrcChannel")
87  .IsUnique()
88  .HasFilter("[IrcChannel] IS NOT NULL");
89 
90  b.ToTable("ChatChannels");
91  });
92 
93  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
94  {
95  b.Property<long>("Id")
96  .ValueGeneratedOnAdd()
97  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
98 
99  b.Property<string>("ByondVersion")
100  .IsRequired();
101 
102  b.Property<Guid?>("DirectoryName")
103  .IsRequired();
104 
105  b.Property<string>("DmeName")
106  .IsRequired();
107 
108  b.Property<long>("JobId");
109 
110  b.Property<int>("MinimumSecurityLevel");
111 
112  b.Property<string>("Output")
113  .IsRequired();
114 
115  b.Property<long>("RevisionInformationId");
116 
117  b.HasKey("Id");
118 
119  b.HasIndex("DirectoryName");
120 
121  b.HasIndex("JobId")
122  .IsUnique();
123 
124  b.HasIndex("RevisionInformationId");
125 
126  b.ToTable("CompileJobs");
127  });
128 
129  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
130  {
131  b.Property<long>("Id")
132  .ValueGeneratedOnAdd()
133  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
134 
135  b.Property<string>("AccessToken");
136 
137  b.Property<bool?>("AllowWebClient")
138  .IsRequired();
139 
140  b.Property<bool?>("AutoStart")
141  .IsRequired();
142 
143  b.Property<long>("InstanceId");
144 
145  b.Property<int>("PrimaryPort");
146 
147  b.Property<int?>("ProcessId");
148 
149  b.Property<int>("SecondaryPort");
150 
151  b.Property<int>("SecurityLevel");
152 
153  b.Property<bool?>("SoftRestart")
154  .IsRequired();
155 
156  b.Property<bool?>("SoftShutdown")
157  .IsRequired();
158 
159  b.Property<long>("StartupTimeout");
160 
161  b.HasKey("Id");
162 
163  b.HasIndex("InstanceId")
164  .IsUnique();
165 
166  b.ToTable("DreamDaemonSettings");
167  });
168 
169  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
170  {
171  b.Property<long>("Id")
172  .ValueGeneratedOnAdd()
173  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
174 
175  b.Property<int>("ApiValidationPort");
176 
177  b.Property<int>("ApiValidationSecurityLevel");
178 
179  b.Property<long>("InstanceId");
180 
181  b.Property<string>("ProjectName");
182 
183  b.HasKey("Id");
184 
185  b.HasIndex("InstanceId")
186  .IsUnique();
187 
188  b.ToTable("DreamMakerSettings");
189  });
190 
191  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
192  {
193  b.Property<long>("Id")
194  .ValueGeneratedOnAdd()
195  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
196 
197  b.Property<long>("AutoUpdateInterval");
198 
199  b.Property<int>("ConfigurationType");
200 
201  b.Property<string>("Name")
202  .IsRequired();
203 
204  b.Property<bool?>("Online")
205  .IsRequired();
206 
207  b.Property<string>("Path")
208  .IsRequired();
209 
210  b.HasKey("Id");
211 
212  b.HasIndex("Path")
213  .IsUnique();
214 
215  b.ToTable("Instances");
216  });
217 
218  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
219  {
220  b.Property<long>("Id")
221  .ValueGeneratedOnAdd()
222  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
223 
224  b.Property<decimal>("ByondRights")
225  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
226 
227  b.Property<decimal>("ChatBotRights")
228  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
229 
230  b.Property<decimal>("ConfigurationRights")
231  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
232 
233  b.Property<decimal>("DreamDaemonRights")
234  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
235 
236  b.Property<decimal>("DreamMakerRights")
237  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
238 
239  b.Property<long>("InstanceId");
240 
241  b.Property<decimal>("InstanceUserRights")
242  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
243 
244  b.Property<decimal>("RepositoryRights")
245  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
246 
247  b.Property<long?>("UserId")
248  .IsRequired();
249 
250  b.HasKey("Id");
251 
252  b.HasIndex("InstanceId");
253 
254  b.HasIndex("UserId", "InstanceId")
255  .IsUnique();
256 
257  b.ToTable("InstanceUsers");
258  });
259 
260  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
261  {
262  b.Property<long>("Id")
263  .ValueGeneratedOnAdd()
264  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
265 
266  b.Property<decimal?>("CancelRight")
267  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
268 
269  b.Property<decimal?>("CancelRightsType")
270  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
271 
272  b.Property<bool?>("Cancelled")
273  .IsRequired();
274 
275  b.Property<long?>("CancelledById");
276 
277  b.Property<string>("Description")
278  .IsRequired();
279 
280  b.Property<string>("ExceptionDetails");
281 
282  b.Property<long>("InstanceId");
283 
284  b.Property<DateTimeOffset?>("StartedAt")
285  .IsRequired();
286 
287  b.Property<long>("StartedById");
288 
289  b.Property<DateTimeOffset?>("StoppedAt");
290 
291  b.HasKey("Id");
292 
293  b.HasIndex("CancelledById");
294 
295  b.HasIndex("InstanceId");
296 
297  b.HasIndex("StartedById");
298 
299  b.ToTable("Jobs");
300  });
301 
302  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
303  {
304  b.Property<long>("Id")
305  .ValueGeneratedOnAdd()
306  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
307 
308  b.Property<string>("AccessIdentifier")
309  .IsRequired();
310 
311  b.Property<string>("ChatChannelsJson")
312  .IsRequired();
313 
314  b.Property<string>("ChatCommandsJson")
315  .IsRequired();
316 
317  b.Property<long>("CompileJobId");
318 
319  b.Property<bool>("IsPrimary");
320 
321  b.Property<int>("Port");
322 
323  b.Property<int>("ProcessId");
324 
325  b.Property<int>("RebootState");
326 
327  b.Property<string>("ServerCommandsJson")
328  .IsRequired();
329 
330  b.HasKey("Id");
331 
332  b.HasIndex("CompileJobId");
333 
334  b.ToTable("ReattachInformations");
335  });
336 
337  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
338  {
339  b.Property<long>("Id")
340  .ValueGeneratedOnAdd()
341  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
342 
343  b.Property<string>("AccessToken");
344 
345  b.Property<string>("AccessUser");
346 
347  b.Property<bool?>("AutoUpdatesKeepTestMerges")
348  .IsRequired();
349 
350  b.Property<bool?>("AutoUpdatesSynchronize")
351  .IsRequired();
352 
353  b.Property<string>("CommitterEmail")
354  .IsRequired();
355 
356  b.Property<string>("CommitterName")
357  .IsRequired();
358 
359  b.Property<long>("InstanceId");
360 
361  b.Property<bool?>("PostTestMergeComment")
362  .IsRequired();
363 
364  b.Property<bool?>("PushTestMergeCommits")
365  .IsRequired();
366 
367  b.Property<bool?>("ShowTestMergeCommitters")
368  .IsRequired();
369 
370  b.HasKey("Id");
371 
372  b.HasIndex("InstanceId")
373  .IsUnique();
374 
375  b.ToTable("RepositorySettings");
376  });
377 
378  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
379  {
380  b.Property<long>("Id")
381  .ValueGeneratedOnAdd()
382  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
383 
384  b.Property<long>("RevisionInformationId");
385 
386  b.Property<long>("TestMergeId");
387 
388  b.HasKey("Id");
389 
390  b.HasIndex("RevisionInformationId");
391 
392  b.HasIndex("TestMergeId");
393 
394  b.ToTable("RevInfoTestMerges");
395  });
396 
397  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
398  {
399  b.Property<long>("Id")
400  .ValueGeneratedOnAdd()
401  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
402 
403  b.Property<string>("CommitSha")
404  .IsRequired()
405  .HasMaxLength(40);
406 
407  b.Property<long>("InstanceId");
408 
409  b.Property<string>("OriginCommitSha")
410  .IsRequired()
411  .HasMaxLength(40);
412 
413  b.HasKey("Id");
414 
415  b.HasIndex("InstanceId", "CommitSha")
416  .IsUnique();
417 
418  b.ToTable("RevisionInformations");
419  });
420 
421  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
422  {
423  b.Property<long>("Id")
424  .ValueGeneratedOnAdd()
425  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
426 
427  b.Property<string>("Author")
428  .IsRequired();
429 
430  b.Property<string>("BodyAtMerge")
431  .IsRequired();
432 
433  b.Property<string>("Comment");
434 
435  b.Property<DateTimeOffset>("MergedAt");
436 
437  b.Property<long>("MergedById");
438 
439  b.Property<int?>("Number")
440  .IsRequired();
441 
442  b.Property<long?>("PrimaryRevisionInformationId")
443  .IsRequired();
444 
445  b.Property<string>("PullRequestRevision")
446  .IsRequired();
447 
448  b.Property<string>("TitleAtMerge")
449  .IsRequired();
450 
451  b.Property<string>("Url")
452  .IsRequired();
453 
454  b.HasKey("Id");
455 
456  b.HasIndex("MergedById");
457 
458  b.HasIndex("PrimaryRevisionInformationId")
459  .IsUnique();
460 
461  b.ToTable("TestMerges");
462  });
463 
464  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
465  {
466  b.Property<long>("Id")
467  .ValueGeneratedOnAdd()
468  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
469 
470  b.Property<decimal>("AdministrationRights")
471  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
472 
473  b.Property<string>("CanonicalName")
474  .IsRequired();
475 
476  b.Property<DateTimeOffset?>("CreatedAt")
477  .IsRequired();
478 
479  b.Property<long?>("CreatedById");
480 
481  b.Property<bool?>("Enabled")
482  .IsRequired();
483 
484  b.Property<decimal>("InstanceManagerRights")
485  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
486 
487  b.Property<DateTimeOffset?>("LastPasswordUpdate");
488 
489  b.Property<string>("Name")
490  .IsRequired();
491 
492  b.Property<string>("PasswordHash");
493 
494  b.Property<string>("SystemIdentifier");
495 
496  b.HasKey("Id");
497 
498  b.HasIndex("CanonicalName")
499  .IsUnique();
500 
501  b.HasIndex("CreatedById");
502 
503  b.ToTable("Users");
504  });
505 
506  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
507  {
508  b.Property<long>("Id")
509  .ValueGeneratedOnAdd()
510  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
511 
512  b.Property<long?>("AlphaId");
513 
514  b.Property<bool>("AlphaIsActive");
515 
516  b.Property<long?>("BravoId");
517 
518  b.Property<long>("InstanceId");
519 
520  b.HasKey("Id");
521 
522  b.HasIndex("AlphaId");
523 
524  b.HasIndex("BravoId");
525 
526  b.HasIndex("InstanceId")
527  .IsUnique();
528 
529  b.ToTable("WatchdogReattachInformations");
530  });
531 
532  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
533  {
534  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
535  .WithMany("ChatSettings")
536  .HasForeignKey("InstanceId")
537  .OnDelete(DeleteBehavior.Cascade);
538  });
539 
540  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
541  {
542  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
543  .WithMany("Channels")
544  .HasForeignKey("ChatSettingsId")
545  .OnDelete(DeleteBehavior.Cascade);
546  });
547 
548  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
549  {
550  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
551  .WithOne()
552  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
553  .OnDelete(DeleteBehavior.Restrict);
554 
555  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
556  .WithMany("CompileJobs")
557  .HasForeignKey("RevisionInformationId")
558  .OnDelete(DeleteBehavior.Cascade);
559  });
560 
561  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
562  {
563  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
564  .WithOne("DreamDaemonSettings")
565  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
566  .OnDelete(DeleteBehavior.Cascade);
567  });
568 
569  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
570  {
571  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
572  .WithOne("DreamMakerSettings")
573  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
574  .OnDelete(DeleteBehavior.Cascade);
575  });
576 
577  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
578  {
579  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
580  .WithMany("InstanceUsers")
581  .HasForeignKey("InstanceId")
582  .OnDelete(DeleteBehavior.Cascade);
583 
584  b.HasOne("Tgstation.Server.Host.Models.User")
585  .WithMany("InstanceUsers")
586  .HasForeignKey("UserId")
587  .OnDelete(DeleteBehavior.Cascade);
588  });
589 
590  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
591  {
592  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
593  .WithMany()
594  .HasForeignKey("CancelledById");
595 
596  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
597  .WithMany("Jobs")
598  .HasForeignKey("InstanceId")
599  .OnDelete(DeleteBehavior.Cascade);
600 
601  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
602  .WithMany()
603  .HasForeignKey("StartedById")
604  .OnDelete(DeleteBehavior.Cascade);
605  });
606 
607  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
608  {
609  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
610  .WithMany()
611  .HasForeignKey("CompileJobId")
612  .OnDelete(DeleteBehavior.Cascade);
613  });
614 
615  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
616  {
617  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
618  .WithOne("RepositorySettings")
619  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
620  .OnDelete(DeleteBehavior.Cascade);
621  });
622 
623  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
624  {
625  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
626  .WithMany("ActiveTestMerges")
627  .HasForeignKey("RevisionInformationId")
628  .OnDelete(DeleteBehavior.Cascade);
629 
630  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
631  .WithMany("RevisonInformations")
632  .HasForeignKey("TestMergeId")
633  .OnDelete(DeleteBehavior.Cascade);
634  });
635 
636  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
637  {
638  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
639  .WithMany("RevisionInformations")
640  .HasForeignKey("InstanceId")
641  .OnDelete(DeleteBehavior.Cascade);
642  });
643 
644  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
645  {
646  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
647  .WithMany("TestMerges")
648  .HasForeignKey("MergedById")
649  .OnDelete(DeleteBehavior.Restrict);
650 
651  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
652  .WithOne("PrimaryTestMerge")
653  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
654  .OnDelete(DeleteBehavior.Restrict);
655  });
656 
657  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
658  {
659  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
660  .WithMany("CreatedUsers")
661  .HasForeignKey("CreatedById");
662  });
663 
664  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
665  {
666  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
667  .WithMany()
668  .HasForeignKey("AlphaId");
669 
670  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
671  .WithMany()
672  .HasForeignKey("BravoId");
673 
674  b.HasOne("Tgstation.Server.Host.Models.Instance")
675  .WithOne("WatchdogReattachInformation")
676  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
677  .OnDelete(DeleteBehavior.Cascade);
678  });
679 #pragma warning restore 612, 618
680  }
681  }
682 }
- +Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
7 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
8 
10 {
11  [DbContext(typeof(SqlServerDatabaseContext))]
12  [Migration("20190219041825_MSFixRevInfoIndex")]
13  partial class MSFixRevInfoIndex
14  {
19  protected override void BuildTargetModel(ModelBuilder modelBuilder)
20  {
21 #pragma warning disable 612, 618
22  modelBuilder
23  .HasAnnotation("ProductVersion", "2.1.4-rtm-31024")
24  .HasAnnotation("Relational:MaxIdentifierLength", 128)
25  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
26 
27  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
28  {
29  b.Property<long>("Id")
30  .ValueGeneratedOnAdd()
31  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
32 
33  b.Property<string>("ConnectionString")
34  .IsRequired();
35 
36  b.Property<bool?>("Enabled");
37 
38  b.Property<long>("InstanceId");
39 
40  b.Property<string>("Name")
41  .IsRequired();
42 
43  b.Property<int?>("Provider");
44 
45  b.HasKey("Id");
46 
47  b.HasIndex("InstanceId");
48 
49  b.HasIndex("Name")
50  .IsUnique();
51 
52  b.ToTable("ChatBots");
53  });
54 
55  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
56  {
57  b.Property<long>("Id")
58  .ValueGeneratedOnAdd()
59  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
60 
61  b.Property<long>("ChatSettingsId");
62 
63  b.Property<decimal?>("DiscordChannelId")
64  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
65 
66  b.Property<string>("IrcChannel");
67 
68  b.Property<bool?>("IsAdminChannel")
69  .IsRequired();
70 
71  b.Property<bool?>("IsUpdatesChannel")
72  .IsRequired();
73 
74  b.Property<bool?>("IsWatchdogChannel")
75  .IsRequired();
76 
77  b.Property<string>("Tag");
78 
79  b.HasKey("Id");
80 
81  b.HasIndex("ChatSettingsId", "DiscordChannelId")
82  .IsUnique()
83  .HasFilter("[DiscordChannelId] IS NOT NULL");
84 
85  b.HasIndex("ChatSettingsId", "IrcChannel")
86  .IsUnique()
87  .HasFilter("[IrcChannel] IS NOT NULL");
88 
89  b.ToTable("ChatChannels");
90  });
91 
92  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
93  {
94  b.Property<long>("Id")
95  .ValueGeneratedOnAdd()
96  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
97 
98  b.Property<string>("ByondVersion")
99  .IsRequired();
100 
101  b.Property<Guid?>("DirectoryName")
102  .IsRequired();
103 
104  b.Property<string>("DmeName")
105  .IsRequired();
106 
107  b.Property<long>("JobId");
108 
109  b.Property<int>("MinimumSecurityLevel");
110 
111  b.Property<string>("Output")
112  .IsRequired();
113 
114  b.Property<long>("RevisionInformationId");
115 
116  b.HasKey("Id");
117 
118  b.HasIndex("DirectoryName");
119 
120  b.HasIndex("JobId")
121  .IsUnique();
122 
123  b.HasIndex("RevisionInformationId");
124 
125  b.ToTable("CompileJobs");
126  });
127 
128  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
129  {
130  b.Property<long>("Id")
131  .ValueGeneratedOnAdd()
132  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
133 
134  b.Property<string>("AccessToken");
135 
136  b.Property<bool?>("AllowWebClient")
137  .IsRequired();
138 
139  b.Property<bool?>("AutoStart")
140  .IsRequired();
141 
142  b.Property<long>("InstanceId");
143 
144  b.Property<int>("PrimaryPort");
145 
146  b.Property<int?>("ProcessId");
147 
148  b.Property<int>("SecondaryPort");
149 
150  b.Property<int>("SecurityLevel");
151 
152  b.Property<bool?>("SoftRestart")
153  .IsRequired();
154 
155  b.Property<bool?>("SoftShutdown")
156  .IsRequired();
157 
158  b.Property<long>("StartupTimeout");
159 
160  b.HasKey("Id");
161 
162  b.HasIndex("InstanceId")
163  .IsUnique();
164 
165  b.ToTable("DreamDaemonSettings");
166  });
167 
168  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
169  {
170  b.Property<long>("Id")
171  .ValueGeneratedOnAdd()
172  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
173 
174  b.Property<int>("ApiValidationPort");
175 
176  b.Property<int>("ApiValidationSecurityLevel");
177 
178  b.Property<long>("InstanceId");
179 
180  b.Property<string>("ProjectName");
181 
182  b.HasKey("Id");
183 
184  b.HasIndex("InstanceId")
185  .IsUnique();
186 
187  b.ToTable("DreamMakerSettings");
188  });
189 
190  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
191  {
192  b.Property<long>("Id")
193  .ValueGeneratedOnAdd()
194  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
195 
196  b.Property<long>("AutoUpdateInterval");
197 
198  b.Property<int>("ConfigurationType");
199 
200  b.Property<string>("Name")
201  .IsRequired();
202 
203  b.Property<bool?>("Online")
204  .IsRequired();
205 
206  b.Property<string>("Path")
207  .IsRequired();
208 
209  b.HasKey("Id");
210 
211  b.HasIndex("Path")
212  .IsUnique();
213 
214  b.ToTable("Instances");
215  });
216 
217  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
218  {
219  b.Property<long>("Id")
220  .ValueGeneratedOnAdd()
221  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
222 
223  b.Property<decimal>("ByondRights")
224  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
225 
226  b.Property<decimal>("ChatBotRights")
227  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
228 
229  b.Property<decimal>("ConfigurationRights")
230  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
231 
232  b.Property<decimal>("DreamDaemonRights")
233  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
234 
235  b.Property<decimal>("DreamMakerRights")
236  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
237 
238  b.Property<long>("InstanceId");
239 
240  b.Property<decimal>("InstanceUserRights")
241  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
242 
243  b.Property<decimal>("RepositoryRights")
244  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
245 
246  b.Property<long?>("UserId")
247  .IsRequired();
248 
249  b.HasKey("Id");
250 
251  b.HasIndex("InstanceId");
252 
253  b.HasIndex("UserId", "InstanceId")
254  .IsUnique();
255 
256  b.ToTable("InstanceUsers");
257  });
258 
259  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
260  {
261  b.Property<long>("Id")
262  .ValueGeneratedOnAdd()
263  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
264 
265  b.Property<decimal?>("CancelRight")
266  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
267 
268  b.Property<decimal?>("CancelRightsType")
269  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
270 
271  b.Property<bool?>("Cancelled")
272  .IsRequired();
273 
274  b.Property<long?>("CancelledById");
275 
276  b.Property<string>("Description")
277  .IsRequired();
278 
279  b.Property<string>("ExceptionDetails");
280 
281  b.Property<long>("InstanceId");
282 
283  b.Property<DateTimeOffset?>("StartedAt")
284  .IsRequired();
285 
286  b.Property<long>("StartedById");
287 
288  b.Property<DateTimeOffset?>("StoppedAt");
289 
290  b.HasKey("Id");
291 
292  b.HasIndex("CancelledById");
293 
294  b.HasIndex("InstanceId");
295 
296  b.HasIndex("StartedById");
297 
298  b.ToTable("Jobs");
299  });
300 
301  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
302  {
303  b.Property<long>("Id")
304  .ValueGeneratedOnAdd()
305  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
306 
307  b.Property<string>("AccessIdentifier")
308  .IsRequired();
309 
310  b.Property<string>("ChatChannelsJson")
311  .IsRequired();
312 
313  b.Property<string>("ChatCommandsJson")
314  .IsRequired();
315 
316  b.Property<long>("CompileJobId");
317 
318  b.Property<bool>("IsPrimary");
319 
320  b.Property<int>("Port");
321 
322  b.Property<int>("ProcessId");
323 
324  b.Property<int>("RebootState");
325 
326  b.Property<string>("ServerCommandsJson")
327  .IsRequired();
328 
329  b.HasKey("Id");
330 
331  b.HasIndex("CompileJobId");
332 
333  b.ToTable("ReattachInformations");
334  });
335 
336  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
337  {
338  b.Property<long>("Id")
339  .ValueGeneratedOnAdd()
340  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
341 
342  b.Property<string>("AccessToken");
343 
344  b.Property<string>("AccessUser");
345 
346  b.Property<bool?>("AutoUpdatesKeepTestMerges")
347  .IsRequired();
348 
349  b.Property<bool?>("AutoUpdatesSynchronize")
350  .IsRequired();
351 
352  b.Property<string>("CommitterEmail")
353  .IsRequired();
354 
355  b.Property<string>("CommitterName")
356  .IsRequired();
357 
358  b.Property<long>("InstanceId");
359 
360  b.Property<bool?>("PostTestMergeComment")
361  .IsRequired();
362 
363  b.Property<bool?>("PushTestMergeCommits")
364  .IsRequired();
365 
366  b.Property<bool?>("ShowTestMergeCommitters")
367  .IsRequired();
368 
369  b.HasKey("Id");
370 
371  b.HasIndex("InstanceId")
372  .IsUnique();
373 
374  b.ToTable("RepositorySettings");
375  });
376 
377  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
378  {
379  b.Property<long>("Id")
380  .ValueGeneratedOnAdd()
381  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
382 
383  b.Property<long>("RevisionInformationId");
384 
385  b.Property<long>("TestMergeId");
386 
387  b.HasKey("Id");
388 
389  b.HasIndex("RevisionInformationId");
390 
391  b.HasIndex("TestMergeId");
392 
393  b.ToTable("RevInfoTestMerges");
394  });
395 
396  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
397  {
398  b.Property<long>("Id")
399  .ValueGeneratedOnAdd()
400  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
401 
402  b.Property<string>("CommitSha")
403  .IsRequired()
404  .HasMaxLength(40);
405 
406  b.Property<long>("InstanceId");
407 
408  b.Property<string>("OriginCommitSha")
409  .IsRequired()
410  .HasMaxLength(40);
411 
412  b.HasKey("Id");
413 
414  b.HasIndex("InstanceId", "CommitSha")
415  .IsUnique();
416 
417  b.ToTable("RevisionInformations");
418  });
419 
420  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
421  {
422  b.Property<long>("Id")
423  .ValueGeneratedOnAdd()
424  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
425 
426  b.Property<string>("Author")
427  .IsRequired();
428 
429  b.Property<string>("BodyAtMerge")
430  .IsRequired();
431 
432  b.Property<string>("Comment");
433 
434  b.Property<DateTimeOffset>("MergedAt");
435 
436  b.Property<long>("MergedById");
437 
438  b.Property<int?>("Number")
439  .IsRequired();
440 
441  b.Property<long?>("PrimaryRevisionInformationId")
442  .IsRequired();
443 
444  b.Property<string>("PullRequestRevision")
445  .IsRequired();
446 
447  b.Property<string>("TitleAtMerge")
448  .IsRequired();
449 
450  b.Property<string>("Url")
451  .IsRequired();
452 
453  b.HasKey("Id");
454 
455  b.HasIndex("MergedById");
456 
457  b.HasIndex("PrimaryRevisionInformationId")
458  .IsUnique();
459 
460  b.ToTable("TestMerges");
461  });
462 
463  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
464  {
465  b.Property<long>("Id")
466  .ValueGeneratedOnAdd()
467  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
468 
469  b.Property<decimal>("AdministrationRights")
470  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
471 
472  b.Property<string>("CanonicalName")
473  .IsRequired();
474 
475  b.Property<DateTimeOffset?>("CreatedAt")
476  .IsRequired();
477 
478  b.Property<long?>("CreatedById");
479 
480  b.Property<bool?>("Enabled")
481  .IsRequired();
482 
483  b.Property<decimal>("InstanceManagerRights")
484  .HasConversion(new ValueConverter<decimal, decimal>(v => default(decimal), v => default(decimal), new ConverterMappingHints(precision: 20, scale: 0)));
485 
486  b.Property<DateTimeOffset?>("LastPasswordUpdate");
487 
488  b.Property<string>("Name")
489  .IsRequired();
490 
491  b.Property<string>("PasswordHash");
492 
493  b.Property<string>("SystemIdentifier");
494 
495  b.HasKey("Id");
496 
497  b.HasIndex("CanonicalName")
498  .IsUnique();
499 
500  b.HasIndex("CreatedById");
501 
502  b.ToTable("Users");
503  });
504 
505  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
506  {
507  b.Property<long>("Id")
508  .ValueGeneratedOnAdd()
509  .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
510 
511  b.Property<long?>("AlphaId");
512 
513  b.Property<bool>("AlphaIsActive");
514 
515  b.Property<long?>("BravoId");
516 
517  b.Property<long>("InstanceId");
518 
519  b.HasKey("Id");
520 
521  b.HasIndex("AlphaId");
522 
523  b.HasIndex("BravoId");
524 
525  b.HasIndex("InstanceId")
526  .IsUnique();
527 
528  b.ToTable("WatchdogReattachInformations");
529  });
530 
531  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
532  {
533  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
534  .WithMany("ChatSettings")
535  .HasForeignKey("InstanceId")
536  .OnDelete(DeleteBehavior.Cascade);
537  });
538 
539  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
540  {
541  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
542  .WithMany("Channels")
543  .HasForeignKey("ChatSettingsId")
544  .OnDelete(DeleteBehavior.Cascade);
545  });
546 
547  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
548  {
549  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
550  .WithOne()
551  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
552  .OnDelete(DeleteBehavior.Restrict);
553 
554  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
555  .WithMany("CompileJobs")
556  .HasForeignKey("RevisionInformationId")
557  .OnDelete(DeleteBehavior.Cascade);
558  });
559 
560  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
561  {
562  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
563  .WithOne("DreamDaemonSettings")
564  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
565  .OnDelete(DeleteBehavior.Cascade);
566  });
567 
568  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
569  {
570  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
571  .WithOne("DreamMakerSettings")
572  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
573  .OnDelete(DeleteBehavior.Cascade);
574  });
575 
576  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
577  {
578  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
579  .WithMany("InstanceUsers")
580  .HasForeignKey("InstanceId")
581  .OnDelete(DeleteBehavior.Cascade);
582 
583  b.HasOne("Tgstation.Server.Host.Models.User")
584  .WithMany("InstanceUsers")
585  .HasForeignKey("UserId")
586  .OnDelete(DeleteBehavior.Cascade);
587  });
588 
589  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
590  {
591  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
592  .WithMany()
593  .HasForeignKey("CancelledById");
594 
595  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
596  .WithMany("Jobs")
597  .HasForeignKey("InstanceId")
598  .OnDelete(DeleteBehavior.Cascade);
599 
600  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
601  .WithMany()
602  .HasForeignKey("StartedById")
603  .OnDelete(DeleteBehavior.Cascade);
604  });
605 
606  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
607  {
608  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
609  .WithMany()
610  .HasForeignKey("CompileJobId")
611  .OnDelete(DeleteBehavior.Cascade);
612  });
613 
614  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
615  {
616  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
617  .WithOne("RepositorySettings")
618  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
619  .OnDelete(DeleteBehavior.Cascade);
620  });
621 
622  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
623  {
624  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
625  .WithMany("ActiveTestMerges")
626  .HasForeignKey("RevisionInformationId")
627  .OnDelete(DeleteBehavior.Cascade);
628 
629  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
630  .WithMany("RevisonInformations")
631  .HasForeignKey("TestMergeId")
632  .OnDelete(DeleteBehavior.Cascade);
633  });
634 
635  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
636  {
637  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
638  .WithMany("RevisionInformations")
639  .HasForeignKey("InstanceId")
640  .OnDelete(DeleteBehavior.Cascade);
641  });
642 
643  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
644  {
645  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
646  .WithMany("TestMerges")
647  .HasForeignKey("MergedById")
648  .OnDelete(DeleteBehavior.Restrict);
649 
650  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
651  .WithOne("PrimaryTestMerge")
652  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
653  .OnDelete(DeleteBehavior.Restrict);
654  });
655 
656  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
657  {
658  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
659  .WithMany("CreatedUsers")
660  .HasForeignKey("CreatedById");
661  });
662 
663  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
664  {
665  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
666  .WithMany()
667  .HasForeignKey("AlphaId");
668 
669  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
670  .WithMany()
671  .HasForeignKey("BravoId");
672 
673  b.HasOne("Tgstation.Server.Host.Models.Instance")
674  .WithOne("WatchdogReattachInformation")
675  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
676  .OnDelete(DeleteBehavior.Cascade);
677  });
678 #pragma warning restore 612, 618
679  }
680  }
681 }
+
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
- -
DatabaseContext<TParentContext> for Sqlserver
- - - -
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
+
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MSFixRevInfoIndex
 Make commit shas non-unique per Instance for MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MSFixRevInfoIndex
 Make commit shas non-unique per Instance for MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20190219041825___m_s_fix_rev_info_index_8cs_source.html b/20190219041825___m_s_fix_rev_info_index_8cs_source.html index 9217431df8..031cb802d1 100644 --- a/20190219041825___m_s_fix_rev_info_index_8cs_source.html +++ b/20190219041825___m_s_fix_rev_info_index_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20190219041825_MSFixRevInfoIndex.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20190219041825_MSFixRevInfoIndex.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,11 +71,11 @@ $(function() {
20190219041825_MSFixRevInfoIndex.cs
-Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MSFixRevInfoIndex : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropIndex(
21  name: "IX_RevisionInformations_CommitSha",
22  table: "RevisionInformations");
23 
24  migrationBuilder.DropIndex(
25  name: "IX_RevisionInformations_InstanceId",
26  table: "RevisionInformations");
27 
28  migrationBuilder.CreateIndex(
29  name: "IX_RevisionInformations_InstanceId_CommitSha",
30  table: "RevisionInformations",
31  columns: new[] { "InstanceId", "CommitSha" },
32  unique: true);
33  }
34 
39  protected override void Down(MigrationBuilder migrationBuilder)
40  {
41  if (migrationBuilder == null)
42  throw new ArgumentNullException(nameof(migrationBuilder));
43 
44  migrationBuilder.DropIndex(
45  name: "IX_RevisionInformations_InstanceId_CommitSha",
46  table: "RevisionInformations");
47 
48  migrationBuilder.CreateIndex(
49  name: "IX_RevisionInformations_CommitSha",
50  table: "RevisionInformations",
51  column: "CommitSha",
52  unique: true);
53 
54  migrationBuilder.CreateIndex(
55  name: "IX_RevisionInformations_InstanceId",
56  table: "RevisionInformations",
57  column: "InstanceId");
58  }
59  }
60 }
+Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MSFixRevInfoIndex : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropIndex(
21  name: "IX_RevisionInformations_CommitSha",
22  table: "RevisionInformations");
23 
24  migrationBuilder.DropIndex(
25  name: "IX_RevisionInformations_InstanceId",
26  table: "RevisionInformations");
27 
28  migrationBuilder.CreateIndex(
29  name: "IX_RevisionInformations_InstanceId_CommitSha",
30  table: "RevisionInformations",
31  columns: new[] { "InstanceId", "CommitSha" },
32  unique: true);
33  }
34 
39  protected override void Down(MigrationBuilder migrationBuilder)
40  {
41  if (migrationBuilder == null)
42  throw new ArgumentNullException(nameof(migrationBuilder));
43 
44  migrationBuilder.DropIndex(
45  name: "IX_RevisionInformations_InstanceId_CommitSha",
46  table: "RevisionInformations");
47 
48  migrationBuilder.CreateIndex(
49  name: "IX_RevisionInformations_CommitSha",
50  table: "RevisionInformations",
51  column: "CommitSha",
52  unique: true);
53 
54  migrationBuilder.CreateIndex(
55  name: "IX_RevisionInformations_InstanceId",
56  table: "RevisionInformations",
57  column: "InstanceId");
58  }
59  }
60 }
+
override void Down(MigrationBuilder migrationBuilder)
Unpplies the migration
-
override void Down(MigrationBuilder migrationBuilder)
Unpplies the migration
-
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
- + +
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MYFixRevInfoIndex
 Make commit shas non-unique per Instance for MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MYFixRevInfoIndex
 Make commit shas non-unique per Instance for MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20190219042440___m_y_fix_rev_info_index_8_designer_8cs_source.html b/20190219042440___m_y_fix_rev_info_index_8_designer_8cs_source.html index 480e1c58ae..56794b588c 100644 --- a/20190219042440___m_y_fix_rev_info_index_8_designer_8cs_source.html +++ b/20190219042440___m_y_fix_rev_info_index_8_designer_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20190219042440_MYFixRevInfoIndex.Designer.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20190219042440_MYFixRevInfoIndex.Designer.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,15 +71,10 @@ $(function() {
20190219042440_MYFixRevInfoIndex.Designer.cs
-Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
7 
9 {
11  [Migration("20190219042440_MYFixRevInfoIndex")]
12  partial class MYFixRevInfoIndex
13  {
18  protected override void BuildTargetModel(ModelBuilder modelBuilder)
19  {
20 #pragma warning disable 612, 618
21  modelBuilder
22  .HasAnnotation("ProductVersion", "2.1.4-rtm-31024")
23  .HasAnnotation("Relational:MaxIdentifierLength", 64);
24 
25  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
26  {
27  b.Property<long>("Id")
28  .ValueGeneratedOnAdd();
29 
30  b.Property<string>("ConnectionString")
31  .IsRequired();
32 
33  b.Property<bool?>("Enabled");
34 
35  b.Property<long>("InstanceId");
36 
37  b.Property<string>("Name")
38  .IsRequired();
39 
40  b.Property<int?>("Provider");
41 
42  b.HasKey("Id");
43 
44  b.HasIndex("InstanceId");
45 
46  b.HasIndex("Name")
47  .IsUnique();
48 
49  b.ToTable("ChatBots");
50  });
51 
52  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
53  {
54  b.Property<long>("Id")
55  .ValueGeneratedOnAdd();
56 
57  b.Property<long>("ChatSettingsId");
58 
59  b.Property<ulong?>("DiscordChannelId");
60 
61  b.Property<string>("IrcChannel");
62 
63  b.Property<bool?>("IsAdminChannel")
64  .IsRequired();
65 
66  b.Property<bool?>("IsUpdatesChannel")
67  .IsRequired();
68 
69  b.Property<bool?>("IsWatchdogChannel")
70  .IsRequired();
71 
72  b.Property<string>("Tag");
73 
74  b.HasKey("Id");
75 
76  b.HasIndex("ChatSettingsId", "DiscordChannelId")
77  .IsUnique();
78 
79  b.HasIndex("ChatSettingsId", "IrcChannel")
80  .IsUnique();
81 
82  b.ToTable("ChatChannels");
83  });
84 
85  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
86  {
87  b.Property<long>("Id")
88  .ValueGeneratedOnAdd();
89 
90  b.Property<string>("ByondVersion")
91  .IsRequired();
92 
93  b.Property<Guid?>("DirectoryName")
94  .IsRequired();
95 
96  b.Property<string>("DmeName")
97  .IsRequired();
98 
99  b.Property<long>("JobId");
100 
101  b.Property<int>("MinimumSecurityLevel");
102 
103  b.Property<string>("Output")
104  .IsRequired();
105 
106  b.Property<long>("RevisionInformationId");
107 
108  b.HasKey("Id");
109 
110  b.HasIndex("DirectoryName");
111 
112  b.HasIndex("JobId")
113  .IsUnique();
114 
115  b.HasIndex("RevisionInformationId");
116 
117  b.ToTable("CompileJobs");
118  });
119 
120  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
121  {
122  b.Property<long>("Id")
123  .ValueGeneratedOnAdd();
124 
125  b.Property<string>("AccessToken");
126 
127  b.Property<bool?>("AllowWebClient")
128  .IsRequired();
129 
130  b.Property<bool?>("AutoStart")
131  .IsRequired();
132 
133  b.Property<long>("InstanceId");
134 
135  b.Property<ushort?>("PrimaryPort")
136  .IsRequired();
137 
138  b.Property<int?>("ProcessId");
139 
140  b.Property<ushort?>("SecondaryPort")
141  .IsRequired();
142 
143  b.Property<int>("SecurityLevel");
144 
145  b.Property<bool?>("SoftRestart")
146  .IsRequired();
147 
148  b.Property<bool?>("SoftShutdown")
149  .IsRequired();
150 
151  b.Property<uint?>("StartupTimeout")
152  .IsRequired();
153 
154  b.HasKey("Id");
155 
156  b.HasIndex("InstanceId")
157  .IsUnique();
158 
159  b.ToTable("DreamDaemonSettings");
160  });
161 
162  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
163  {
164  b.Property<long>("Id")
165  .ValueGeneratedOnAdd();
166 
167  b.Property<ushort?>("ApiValidationPort")
168  .IsRequired();
169 
170  b.Property<int>("ApiValidationSecurityLevel");
171 
172  b.Property<long>("InstanceId");
173 
174  b.Property<string>("ProjectName");
175 
176  b.HasKey("Id");
177 
178  b.HasIndex("InstanceId")
179  .IsUnique();
180 
181  b.ToTable("DreamMakerSettings");
182  });
183 
184  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
185  {
186  b.Property<long>("Id")
187  .ValueGeneratedOnAdd();
188 
189  b.Property<uint?>("AutoUpdateInterval")
190  .IsRequired();
191 
192  b.Property<int>("ConfigurationType");
193 
194  b.Property<string>("Name")
195  .IsRequired();
196 
197  b.Property<bool?>("Online")
198  .IsRequired();
199 
200  b.Property<string>("Path")
201  .IsRequired();
202 
203  b.HasKey("Id");
204 
205  b.HasIndex("Path")
206  .IsUnique();
207 
208  b.ToTable("Instances");
209  });
210 
211  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
212  {
213  b.Property<long>("Id")
214  .ValueGeneratedOnAdd();
215 
216  b.Property<ulong>("ByondRights");
217 
218  b.Property<ulong>("ChatBotRights");
219 
220  b.Property<ulong>("ConfigurationRights");
221 
222  b.Property<ulong>("DreamDaemonRights");
223 
224  b.Property<ulong>("DreamMakerRights");
225 
226  b.Property<long>("InstanceId");
227 
228  b.Property<ulong>("InstanceUserRights");
229 
230  b.Property<ulong>("RepositoryRights");
231 
232  b.Property<long?>("UserId")
233  .IsRequired();
234 
235  b.HasKey("Id");
236 
237  b.HasIndex("InstanceId");
238 
239  b.HasIndex("UserId", "InstanceId")
240  .IsUnique();
241 
242  b.ToTable("InstanceUsers");
243  });
244 
245  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
246  {
247  b.Property<long>("Id")
248  .ValueGeneratedOnAdd();
249 
250  b.Property<ulong?>("CancelRight");
251 
252  b.Property<ulong?>("CancelRightsType");
253 
254  b.Property<bool?>("Cancelled")
255  .IsRequired();
256 
257  b.Property<long?>("CancelledById");
258 
259  b.Property<string>("Description")
260  .IsRequired();
261 
262  b.Property<string>("ExceptionDetails");
263 
264  b.Property<long>("InstanceId");
265 
266  b.Property<DateTimeOffset?>("StartedAt")
267  .IsRequired();
268 
269  b.Property<long>("StartedById");
270 
271  b.Property<DateTimeOffset?>("StoppedAt");
272 
273  b.HasKey("Id");
274 
275  b.HasIndex("CancelledById");
276 
277  b.HasIndex("InstanceId");
278 
279  b.HasIndex("StartedById");
280 
281  b.ToTable("Jobs");
282  });
283 
284  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
285  {
286  b.Property<long>("Id")
287  .ValueGeneratedOnAdd();
288 
289  b.Property<string>("AccessIdentifier")
290  .IsRequired();
291 
292  b.Property<string>("ChatChannelsJson")
293  .IsRequired();
294 
295  b.Property<string>("ChatCommandsJson")
296  .IsRequired();
297 
298  b.Property<long>("CompileJobId");
299 
300  b.Property<bool>("IsPrimary");
301 
302  b.Property<ushort>("Port");
303 
304  b.Property<int>("ProcessId");
305 
306  b.Property<int>("RebootState");
307 
308  b.Property<string>("ServerCommandsJson")
309  .IsRequired();
310 
311  b.HasKey("Id");
312 
313  b.HasIndex("CompileJobId");
314 
315  b.ToTable("ReattachInformations");
316  });
317 
318  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
319  {
320  b.Property<long>("Id")
321  .ValueGeneratedOnAdd();
322 
323  b.Property<string>("AccessToken");
324 
325  b.Property<string>("AccessUser");
326 
327  b.Property<bool?>("AutoUpdatesKeepTestMerges")
328  .IsRequired();
329 
330  b.Property<bool?>("AutoUpdatesSynchronize")
331  .IsRequired();
332 
333  b.Property<string>("CommitterEmail")
334  .IsRequired();
335 
336  b.Property<string>("CommitterName")
337  .IsRequired();
338 
339  b.Property<long>("InstanceId");
340 
341  b.Property<bool?>("PostTestMergeComment")
342  .IsRequired();
343 
344  b.Property<bool?>("PushTestMergeCommits")
345  .IsRequired();
346 
347  b.Property<bool?>("ShowTestMergeCommitters")
348  .IsRequired();
349 
350  b.HasKey("Id");
351 
352  b.HasIndex("InstanceId")
353  .IsUnique();
354 
355  b.ToTable("RepositorySettings");
356  });
357 
358  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
359  {
360  b.Property<long>("Id")
361  .ValueGeneratedOnAdd();
362 
363  b.Property<long>("RevisionInformationId");
364 
365  b.Property<long>("TestMergeId");
366 
367  b.HasKey("Id");
368 
369  b.HasIndex("RevisionInformationId");
370 
371  b.HasIndex("TestMergeId");
372 
373  b.ToTable("RevInfoTestMerges");
374  });
375 
376  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
377  {
378  b.Property<long>("Id")
379  .ValueGeneratedOnAdd();
380 
381  b.Property<string>("CommitSha")
382  .IsRequired()
383  .HasMaxLength(40);
384 
385  b.Property<long>("InstanceId");
386 
387  b.Property<string>("OriginCommitSha")
388  .IsRequired()
389  .HasMaxLength(40);
390 
391  b.HasKey("Id");
392 
393  b.HasIndex("InstanceId", "CommitSha")
394  .IsUnique();
395 
396  b.ToTable("RevisionInformations");
397  });
398 
399  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
400  {
401  b.Property<long>("Id")
402  .ValueGeneratedOnAdd();
403 
404  b.Property<string>("Author")
405  .IsRequired();
406 
407  b.Property<string>("BodyAtMerge")
408  .IsRequired();
409 
410  b.Property<string>("Comment");
411 
412  b.Property<DateTimeOffset>("MergedAt");
413 
414  b.Property<long>("MergedById");
415 
416  b.Property<int?>("Number")
417  .IsRequired();
418 
419  b.Property<long?>("PrimaryRevisionInformationId")
420  .IsRequired();
421 
422  b.Property<string>("PullRequestRevision")
423  .IsRequired();
424 
425  b.Property<string>("TitleAtMerge")
426  .IsRequired();
427 
428  b.Property<string>("Url")
429  .IsRequired();
430 
431  b.HasKey("Id");
432 
433  b.HasIndex("MergedById");
434 
435  b.HasIndex("PrimaryRevisionInformationId")
436  .IsUnique();
437 
438  b.ToTable("TestMerges");
439  });
440 
441  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
442  {
443  b.Property<long>("Id")
444  .ValueGeneratedOnAdd();
445 
446  b.Property<ulong>("AdministrationRights");
447 
448  b.Property<string>("CanonicalName")
449  .IsRequired();
450 
451  b.Property<DateTimeOffset?>("CreatedAt")
452  .IsRequired();
453 
454  b.Property<long?>("CreatedById");
455 
456  b.Property<bool?>("Enabled")
457  .IsRequired();
458 
459  b.Property<ulong>("InstanceManagerRights");
460 
461  b.Property<DateTimeOffset?>("LastPasswordUpdate");
462 
463  b.Property<string>("Name")
464  .IsRequired();
465 
466  b.Property<string>("PasswordHash");
467 
468  b.Property<string>("SystemIdentifier");
469 
470  b.HasKey("Id");
471 
472  b.HasIndex("CanonicalName")
473  .IsUnique();
474 
475  b.HasIndex("CreatedById");
476 
477  b.ToTable("Users");
478  });
479 
480  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
481  {
482  b.Property<long>("Id")
483  .ValueGeneratedOnAdd();
484 
485  b.Property<long?>("AlphaId");
486 
487  b.Property<bool>("AlphaIsActive");
488 
489  b.Property<long?>("BravoId");
490 
491  b.Property<long>("InstanceId");
492 
493  b.HasKey("Id");
494 
495  b.HasIndex("AlphaId");
496 
497  b.HasIndex("BravoId");
498 
499  b.HasIndex("InstanceId")
500  .IsUnique();
501 
502  b.ToTable("WatchdogReattachInformations");
503  });
504 
505  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
506  {
507  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
508  .WithMany("ChatSettings")
509  .HasForeignKey("InstanceId")
510  .OnDelete(DeleteBehavior.Cascade);
511  });
512 
513  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
514  {
515  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
516  .WithMany("Channels")
517  .HasForeignKey("ChatSettingsId")
518  .OnDelete(DeleteBehavior.Cascade);
519  });
520 
521  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
522  {
523  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
524  .WithOne()
525  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
526  .OnDelete(DeleteBehavior.Restrict);
527 
528  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
529  .WithMany("CompileJobs")
530  .HasForeignKey("RevisionInformationId")
531  .OnDelete(DeleteBehavior.Cascade);
532  });
533 
534  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
535  {
536  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
537  .WithOne("DreamDaemonSettings")
538  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
539  .OnDelete(DeleteBehavior.Cascade);
540  });
541 
542  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
543  {
544  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
545  .WithOne("DreamMakerSettings")
546  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
547  .OnDelete(DeleteBehavior.Cascade);
548  });
549 
550  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
551  {
552  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
553  .WithMany("InstanceUsers")
554  .HasForeignKey("InstanceId")
555  .OnDelete(DeleteBehavior.Cascade);
556 
557  b.HasOne("Tgstation.Server.Host.Models.User")
558  .WithMany("InstanceUsers")
559  .HasForeignKey("UserId")
560  .OnDelete(DeleteBehavior.Cascade);
561  });
562 
563  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
564  {
565  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
566  .WithMany()
567  .HasForeignKey("CancelledById");
568 
569  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
570  .WithMany("Jobs")
571  .HasForeignKey("InstanceId")
572  .OnDelete(DeleteBehavior.Cascade);
573 
574  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
575  .WithMany()
576  .HasForeignKey("StartedById")
577  .OnDelete(DeleteBehavior.Cascade);
578  });
579 
580  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
581  {
582  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
583  .WithMany()
584  .HasForeignKey("CompileJobId")
585  .OnDelete(DeleteBehavior.Cascade);
586  });
587 
588  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
589  {
590  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
591  .WithOne("RepositorySettings")
592  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
593  .OnDelete(DeleteBehavior.Cascade);
594  });
595 
596  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
597  {
598  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
599  .WithMany("ActiveTestMerges")
600  .HasForeignKey("RevisionInformationId")
601  .OnDelete(DeleteBehavior.Cascade);
602 
603  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
604  .WithMany("RevisonInformations")
605  .HasForeignKey("TestMergeId")
606  .OnDelete(DeleteBehavior.Cascade);
607  });
608 
609  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
610  {
611  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
612  .WithMany("RevisionInformations")
613  .HasForeignKey("InstanceId")
614  .OnDelete(DeleteBehavior.Cascade);
615  });
616 
617  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
618  {
619  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
620  .WithMany("TestMerges")
621  .HasForeignKey("MergedById")
622  .OnDelete(DeleteBehavior.Restrict);
623 
624  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
625  .WithOne("PrimaryTestMerge")
626  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
627  .OnDelete(DeleteBehavior.Restrict);
628  });
629 
630  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
631  {
632  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
633  .WithMany("CreatedUsers")
634  .HasForeignKey("CreatedById");
635  });
636 
637  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
638  {
639  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
640  .WithMany()
641  .HasForeignKey("AlphaId");
642 
643  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
644  .WithMany()
645  .HasForeignKey("BravoId");
646 
647  b.HasOne("Tgstation.Server.Host.Models.Instance")
648  .WithOne("WatchdogReattachInformation")
649  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
650  .OnDelete(DeleteBehavior.Cascade);
651  });
652 #pragma warning restore 612, 618
653  }
654  }
655 }
- -
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
+Go to the documentation of this file.
1 // <auto-generated />
2 using System;
3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Migrations;
6 
8 {
9  [DbContext(typeof(MySqlDatabaseContext))]
10  [Migration("20190219042440_MYFixRevInfoIndex")]
11  partial class MYFixRevInfoIndex
12  {
17  protected override void BuildTargetModel(ModelBuilder modelBuilder)
18  {
19 #pragma warning disable 612, 618
20  modelBuilder
21  .HasAnnotation("ProductVersion", "2.1.4-rtm-31024")
22  .HasAnnotation("Relational:MaxIdentifierLength", 64);
23 
24  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
25  {
26  b.Property<long>("Id")
27  .ValueGeneratedOnAdd();
28 
29  b.Property<string>("ConnectionString")
30  .IsRequired();
31 
32  b.Property<bool?>("Enabled");
33 
34  b.Property<long>("InstanceId");
35 
36  b.Property<string>("Name")
37  .IsRequired();
38 
39  b.Property<int?>("Provider");
40 
41  b.HasKey("Id");
42 
43  b.HasIndex("InstanceId");
44 
45  b.HasIndex("Name")
46  .IsUnique();
47 
48  b.ToTable("ChatBots");
49  });
50 
51  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
52  {
53  b.Property<long>("Id")
54  .ValueGeneratedOnAdd();
55 
56  b.Property<long>("ChatSettingsId");
57 
58  b.Property<ulong?>("DiscordChannelId");
59 
60  b.Property<string>("IrcChannel");
61 
62  b.Property<bool?>("IsAdminChannel")
63  .IsRequired();
64 
65  b.Property<bool?>("IsUpdatesChannel")
66  .IsRequired();
67 
68  b.Property<bool?>("IsWatchdogChannel")
69  .IsRequired();
70 
71  b.Property<string>("Tag");
72 
73  b.HasKey("Id");
74 
75  b.HasIndex("ChatSettingsId", "DiscordChannelId")
76  .IsUnique();
77 
78  b.HasIndex("ChatSettingsId", "IrcChannel")
79  .IsUnique();
80 
81  b.ToTable("ChatChannels");
82  });
83 
84  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
85  {
86  b.Property<long>("Id")
87  .ValueGeneratedOnAdd();
88 
89  b.Property<string>("ByondVersion")
90  .IsRequired();
91 
92  b.Property<Guid?>("DirectoryName")
93  .IsRequired();
94 
95  b.Property<string>("DmeName")
96  .IsRequired();
97 
98  b.Property<long>("JobId");
99 
100  b.Property<int>("MinimumSecurityLevel");
101 
102  b.Property<string>("Output")
103  .IsRequired();
104 
105  b.Property<long>("RevisionInformationId");
106 
107  b.HasKey("Id");
108 
109  b.HasIndex("DirectoryName");
110 
111  b.HasIndex("JobId")
112  .IsUnique();
113 
114  b.HasIndex("RevisionInformationId");
115 
116  b.ToTable("CompileJobs");
117  });
118 
119  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
120  {
121  b.Property<long>("Id")
122  .ValueGeneratedOnAdd();
123 
124  b.Property<string>("AccessToken");
125 
126  b.Property<bool?>("AllowWebClient")
127  .IsRequired();
128 
129  b.Property<bool?>("AutoStart")
130  .IsRequired();
131 
132  b.Property<long>("InstanceId");
133 
134  b.Property<ushort?>("PrimaryPort")
135  .IsRequired();
136 
137  b.Property<int?>("ProcessId");
138 
139  b.Property<ushort?>("SecondaryPort")
140  .IsRequired();
141 
142  b.Property<int>("SecurityLevel");
143 
144  b.Property<bool?>("SoftRestart")
145  .IsRequired();
146 
147  b.Property<bool?>("SoftShutdown")
148  .IsRequired();
149 
150  b.Property<uint?>("StartupTimeout")
151  .IsRequired();
152 
153  b.HasKey("Id");
154 
155  b.HasIndex("InstanceId")
156  .IsUnique();
157 
158  b.ToTable("DreamDaemonSettings");
159  });
160 
161  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
162  {
163  b.Property<long>("Id")
164  .ValueGeneratedOnAdd();
165 
166  b.Property<ushort?>("ApiValidationPort")
167  .IsRequired();
168 
169  b.Property<int>("ApiValidationSecurityLevel");
170 
171  b.Property<long>("InstanceId");
172 
173  b.Property<string>("ProjectName");
174 
175  b.HasKey("Id");
176 
177  b.HasIndex("InstanceId")
178  .IsUnique();
179 
180  b.ToTable("DreamMakerSettings");
181  });
182 
183  modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b =>
184  {
185  b.Property<long>("Id")
186  .ValueGeneratedOnAdd();
187 
188  b.Property<uint?>("AutoUpdateInterval")
189  .IsRequired();
190 
191  b.Property<int>("ConfigurationType");
192 
193  b.Property<string>("Name")
194  .IsRequired();
195 
196  b.Property<bool?>("Online")
197  .IsRequired();
198 
199  b.Property<string>("Path")
200  .IsRequired();
201 
202  b.HasKey("Id");
203 
204  b.HasIndex("Path")
205  .IsUnique();
206 
207  b.ToTable("Instances");
208  });
209 
210  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
211  {
212  b.Property<long>("Id")
213  .ValueGeneratedOnAdd();
214 
215  b.Property<ulong>("ByondRights");
216 
217  b.Property<ulong>("ChatBotRights");
218 
219  b.Property<ulong>("ConfigurationRights");
220 
221  b.Property<ulong>("DreamDaemonRights");
222 
223  b.Property<ulong>("DreamMakerRights");
224 
225  b.Property<long>("InstanceId");
226 
227  b.Property<ulong>("InstanceUserRights");
228 
229  b.Property<ulong>("RepositoryRights");
230 
231  b.Property<long?>("UserId")
232  .IsRequired();
233 
234  b.HasKey("Id");
235 
236  b.HasIndex("InstanceId");
237 
238  b.HasIndex("UserId", "InstanceId")
239  .IsUnique();
240 
241  b.ToTable("InstanceUsers");
242  });
243 
244  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
245  {
246  b.Property<long>("Id")
247  .ValueGeneratedOnAdd();
248 
249  b.Property<ulong?>("CancelRight");
250 
251  b.Property<ulong?>("CancelRightsType");
252 
253  b.Property<bool?>("Cancelled")
254  .IsRequired();
255 
256  b.Property<long?>("CancelledById");
257 
258  b.Property<string>("Description")
259  .IsRequired();
260 
261  b.Property<string>("ExceptionDetails");
262 
263  b.Property<long>("InstanceId");
264 
265  b.Property<DateTimeOffset?>("StartedAt")
266  .IsRequired();
267 
268  b.Property<long>("StartedById");
269 
270  b.Property<DateTimeOffset?>("StoppedAt");
271 
272  b.HasKey("Id");
273 
274  b.HasIndex("CancelledById");
275 
276  b.HasIndex("InstanceId");
277 
278  b.HasIndex("StartedById");
279 
280  b.ToTable("Jobs");
281  });
282 
283  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
284  {
285  b.Property<long>("Id")
286  .ValueGeneratedOnAdd();
287 
288  b.Property<string>("AccessIdentifier")
289  .IsRequired();
290 
291  b.Property<string>("ChatChannelsJson")
292  .IsRequired();
293 
294  b.Property<string>("ChatCommandsJson")
295  .IsRequired();
296 
297  b.Property<long>("CompileJobId");
298 
299  b.Property<bool>("IsPrimary");
300 
301  b.Property<ushort>("Port");
302 
303  b.Property<int>("ProcessId");
304 
305  b.Property<int>("RebootState");
306 
307  b.Property<string>("ServerCommandsJson")
308  .IsRequired();
309 
310  b.HasKey("Id");
311 
312  b.HasIndex("CompileJobId");
313 
314  b.ToTable("ReattachInformations");
315  });
316 
317  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
318  {
319  b.Property<long>("Id")
320  .ValueGeneratedOnAdd();
321 
322  b.Property<string>("AccessToken");
323 
324  b.Property<string>("AccessUser");
325 
326  b.Property<bool?>("AutoUpdatesKeepTestMerges")
327  .IsRequired();
328 
329  b.Property<bool?>("AutoUpdatesSynchronize")
330  .IsRequired();
331 
332  b.Property<string>("CommitterEmail")
333  .IsRequired();
334 
335  b.Property<string>("CommitterName")
336  .IsRequired();
337 
338  b.Property<long>("InstanceId");
339 
340  b.Property<bool?>("PostTestMergeComment")
341  .IsRequired();
342 
343  b.Property<bool?>("PushTestMergeCommits")
344  .IsRequired();
345 
346  b.Property<bool?>("ShowTestMergeCommitters")
347  .IsRequired();
348 
349  b.HasKey("Id");
350 
351  b.HasIndex("InstanceId")
352  .IsUnique();
353 
354  b.ToTable("RepositorySettings");
355  });
356 
357  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
358  {
359  b.Property<long>("Id")
360  .ValueGeneratedOnAdd();
361 
362  b.Property<long>("RevisionInformationId");
363 
364  b.Property<long>("TestMergeId");
365 
366  b.HasKey("Id");
367 
368  b.HasIndex("RevisionInformationId");
369 
370  b.HasIndex("TestMergeId");
371 
372  b.ToTable("RevInfoTestMerges");
373  });
374 
375  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
376  {
377  b.Property<long>("Id")
378  .ValueGeneratedOnAdd();
379 
380  b.Property<string>("CommitSha")
381  .IsRequired()
382  .HasMaxLength(40);
383 
384  b.Property<long>("InstanceId");
385 
386  b.Property<string>("OriginCommitSha")
387  .IsRequired()
388  .HasMaxLength(40);
389 
390  b.HasKey("Id");
391 
392  b.HasIndex("InstanceId", "CommitSha")
393  .IsUnique();
394 
395  b.ToTable("RevisionInformations");
396  });
397 
398  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
399  {
400  b.Property<long>("Id")
401  .ValueGeneratedOnAdd();
402 
403  b.Property<string>("Author")
404  .IsRequired();
405 
406  b.Property<string>("BodyAtMerge")
407  .IsRequired();
408 
409  b.Property<string>("Comment");
410 
411  b.Property<DateTimeOffset>("MergedAt");
412 
413  b.Property<long>("MergedById");
414 
415  b.Property<int?>("Number")
416  .IsRequired();
417 
418  b.Property<long?>("PrimaryRevisionInformationId")
419  .IsRequired();
420 
421  b.Property<string>("PullRequestRevision")
422  .IsRequired();
423 
424  b.Property<string>("TitleAtMerge")
425  .IsRequired();
426 
427  b.Property<string>("Url")
428  .IsRequired();
429 
430  b.HasKey("Id");
431 
432  b.HasIndex("MergedById");
433 
434  b.HasIndex("PrimaryRevisionInformationId")
435  .IsUnique();
436 
437  b.ToTable("TestMerges");
438  });
439 
440  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
441  {
442  b.Property<long>("Id")
443  .ValueGeneratedOnAdd();
444 
445  b.Property<ulong>("AdministrationRights");
446 
447  b.Property<string>("CanonicalName")
448  .IsRequired();
449 
450  b.Property<DateTimeOffset?>("CreatedAt")
451  .IsRequired();
452 
453  b.Property<long?>("CreatedById");
454 
455  b.Property<bool?>("Enabled")
456  .IsRequired();
457 
458  b.Property<ulong>("InstanceManagerRights");
459 
460  b.Property<DateTimeOffset?>("LastPasswordUpdate");
461 
462  b.Property<string>("Name")
463  .IsRequired();
464 
465  b.Property<string>("PasswordHash");
466 
467  b.Property<string>("SystemIdentifier");
468 
469  b.HasKey("Id");
470 
471  b.HasIndex("CanonicalName")
472  .IsUnique();
473 
474  b.HasIndex("CreatedById");
475 
476  b.ToTable("Users");
477  });
478 
479  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
480  {
481  b.Property<long>("Id")
482  .ValueGeneratedOnAdd();
483 
484  b.Property<long?>("AlphaId");
485 
486  b.Property<bool>("AlphaIsActive");
487 
488  b.Property<long?>("BravoId");
489 
490  b.Property<long>("InstanceId");
491 
492  b.HasKey("Id");
493 
494  b.HasIndex("AlphaId");
495 
496  b.HasIndex("BravoId");
497 
498  b.HasIndex("InstanceId")
499  .IsUnique();
500 
501  b.ToTable("WatchdogReattachInformations");
502  });
503 
504  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
505  {
506  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
507  .WithMany("ChatSettings")
508  .HasForeignKey("InstanceId")
509  .OnDelete(DeleteBehavior.Cascade);
510  });
511 
512  modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b =>
513  {
514  b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings")
515  .WithMany("Channels")
516  .HasForeignKey("ChatSettingsId")
517  .OnDelete(DeleteBehavior.Cascade);
518  });
519 
520  modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b =>
521  {
522  b.HasOne("Tgstation.Server.Host.Models.Job", "Job")
523  .WithOne()
524  .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId")
525  .OnDelete(DeleteBehavior.Restrict);
526 
527  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
528  .WithMany("CompileJobs")
529  .HasForeignKey("RevisionInformationId")
530  .OnDelete(DeleteBehavior.Cascade);
531  });
532 
533  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b =>
534  {
535  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
536  .WithOne("DreamDaemonSettings")
537  .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId")
538  .OnDelete(DeleteBehavior.Cascade);
539  });
540 
541  modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b =>
542  {
543  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
544  .WithOne("DreamMakerSettings")
545  .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId")
546  .OnDelete(DeleteBehavior.Cascade);
547  });
548 
549  modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b =>
550  {
551  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
552  .WithMany("InstanceUsers")
553  .HasForeignKey("InstanceId")
554  .OnDelete(DeleteBehavior.Cascade);
555 
556  b.HasOne("Tgstation.Server.Host.Models.User")
557  .WithMany("InstanceUsers")
558  .HasForeignKey("UserId")
559  .OnDelete(DeleteBehavior.Cascade);
560  });
561 
562  modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b =>
563  {
564  b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy")
565  .WithMany()
566  .HasForeignKey("CancelledById");
567 
568  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
569  .WithMany("Jobs")
570  .HasForeignKey("InstanceId")
571  .OnDelete(DeleteBehavior.Cascade);
572 
573  b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy")
574  .WithMany()
575  .HasForeignKey("StartedById")
576  .OnDelete(DeleteBehavior.Cascade);
577  });
578 
579  modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b =>
580  {
581  b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob")
582  .WithMany()
583  .HasForeignKey("CompileJobId")
584  .OnDelete(DeleteBehavior.Cascade);
585  });
586 
587  modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b =>
588  {
589  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
590  .WithOne("RepositorySettings")
591  .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId")
592  .OnDelete(DeleteBehavior.Cascade);
593  });
594 
595  modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b =>
596  {
597  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation")
598  .WithMany("ActiveTestMerges")
599  .HasForeignKey("RevisionInformationId")
600  .OnDelete(DeleteBehavior.Cascade);
601 
602  b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge")
603  .WithMany("RevisonInformations")
604  .HasForeignKey("TestMergeId")
605  .OnDelete(DeleteBehavior.Cascade);
606  });
607 
608  modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b =>
609  {
610  b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance")
611  .WithMany("RevisionInformations")
612  .HasForeignKey("InstanceId")
613  .OnDelete(DeleteBehavior.Cascade);
614  });
615 
616  modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b =>
617  {
618  b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy")
619  .WithMany("TestMerges")
620  .HasForeignKey("MergedById")
621  .OnDelete(DeleteBehavior.Restrict);
622 
623  b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation")
624  .WithOne("PrimaryTestMerge")
625  .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId")
626  .OnDelete(DeleteBehavior.Restrict);
627  });
628 
629  modelBuilder.Entity("Tgstation.Server.Host.Models.User", b =>
630  {
631  b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy")
632  .WithMany("CreatedUsers")
633  .HasForeignKey("CreatedById");
634  });
635 
636  modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b =>
637  {
638  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha")
639  .WithMany()
640  .HasForeignKey("AlphaId");
641 
642  b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo")
643  .WithMany()
644  .HasForeignKey("BravoId");
645 
646  b.HasOne("Tgstation.Server.Host.Models.Instance")
647  .WithOne("WatchdogReattachInformation")
648  .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId")
649  .OnDelete(DeleteBehavior.Cascade);
650  });
651 #pragma warning restore 612, 618
652  }
653  }
654 }
-
DatabaseContext<TParentContext> for MySQL
- - - - +
override void BuildTargetModel(ModelBuilder modelBuilder)
Builds the target model
+
@@ -79,8 +79,8 @@ $(function() { - - + +

Classes

class  Tgstation.Server.Host.Models.Migrations.MYFixRevInfoIndex
 Make commit shas non-unique per Instance for MSSQL More...
class  Tgstation.Server.Host.Database.Migrations.MYFixRevInfoIndex
 Make commit shas non-unique per Instance for MSSQL More...
 
- + - +

@@ -91,9 +91,9 @@ Namespaces

 
namespace  Tgstation.Server.Host
 
namespace  Tgstation.Server.Host.Models
namespace  Tgstation.Server.Host.Database
 
namespace  Tgstation.Server.Host.Models.Migrations
namespace  Tgstation.Server.Host.Database.Migrations
 
diff --git a/20190219042440___m_y_fix_rev_info_index_8cs_source.html b/20190219042440___m_y_fix_rev_info_index_8cs_source.html index dd0a9c4fc4..95b5711dd7 100644 --- a/20190219042440___m_y_fix_rev_info_index_8cs_source.html +++ b/20190219042440___m_y_fix_rev_info_index_8cs_source.html @@ -5,7 +5,7 @@ -tgstation-server: src/Tgstation.Server.Host/Models/Migrations/20190219042440_MYFixRevInfoIndex.cs Source File +tgstation-server: src/Tgstation.Server.Host/Database/Migrations/20190219042440_MYFixRevInfoIndex.cs Source File @@ -63,7 +63,7 @@ $(function() {
@@ -71,11 +71,11 @@ $(function() {
20190219042440_MYFixRevInfoIndex.cs
-Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MYFixRevInfoIndex : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropForeignKey(
21  name: "FK_RevisionInformations_Instances_InstanceId",
22  table: "RevisionInformations");
23 
24  migrationBuilder.DropIndex(
25  name: "IX_RevisionInformations_CommitSha",
26  table: "RevisionInformations");
27 
28  migrationBuilder.DropIndex(
29  name: "IX_RevisionInformations_InstanceId",
30  table: "RevisionInformations");
31 
32  migrationBuilder.CreateIndex(
33  name: "IX_RevisionInformations_InstanceId_CommitSha",
34  table: "RevisionInformations",
35  columns: new[] { "InstanceId", "CommitSha" },
36  unique: true);
37 
38  migrationBuilder.AddForeignKey(
39  name: "FK_RevisionInformations_Instances_InstanceId",
40  table: "RevisionInformations",
41  column: "InstanceId",
42  principalTable: "Instances",
43  principalColumn: "Id",
44  onDelete: ReferentialAction.Cascade);
45  }
46 
51  protected override void Down(MigrationBuilder migrationBuilder)
52  {
53  if (migrationBuilder == null)
54  throw new ArgumentNullException(nameof(migrationBuilder));
55 
56  migrationBuilder.DropForeignKey(
57  name: "FK_RevisionInformations_Instances_InstanceId",
58  table: "RevisionInformations");
59 
60  migrationBuilder.DropIndex(
61  name: "IX_RevisionInformations_InstanceId_CommitSha",
62  table: "RevisionInformations");
63 
64  migrationBuilder.CreateIndex(
65  name: "IX_RevisionInformations_CommitSha",
66  table: "RevisionInformations",
67  column: "CommitSha",
68  unique: true);
69 
70  migrationBuilder.CreateIndex(
71  name: "IX_RevisionInformations_InstanceId",
72  table: "RevisionInformations",
73  column: "InstanceId");
74 
75  migrationBuilder.AddForeignKey(
76  name: "FK_RevisionInformations_Instances_InstanceId",
77  table: "RevisionInformations",
78  column: "InstanceId",
79  principalTable: "Instances",
80  principalColumn: "Id",
81  onDelete: ReferentialAction.Cascade);
82  }
83  }
84 }
+Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore.Migrations;
2 using System;
3 
5 {
9  public partial class MYFixRevInfoIndex : Migration
10  {
15  protected override void Up(MigrationBuilder migrationBuilder)
16  {
17  if (migrationBuilder == null)
18  throw new ArgumentNullException(nameof(migrationBuilder));
19 
20  migrationBuilder.DropForeignKey(
21  name: "FK_RevisionInformations_Instances_InstanceId",
22  table: "RevisionInformations");
23 
24  migrationBuilder.DropIndex(
25  name: "IX_RevisionInformations_CommitSha",
26  table: "RevisionInformations");
27 
28  migrationBuilder.DropIndex(
29  name: "IX_RevisionInformations_InstanceId",
30  table: "RevisionInformations");
31 
32  migrationBuilder.CreateIndex(
33  name: "IX_RevisionInformations_InstanceId_CommitSha",
34  table: "RevisionInformations",
35  columns: new[] { "InstanceId", "CommitSha" },
36  unique: true);
37 
38  migrationBuilder.AddForeignKey(
39  name: "FK_RevisionInformations_Instances_InstanceId",
40  table: "RevisionInformations",
41  column: "InstanceId",
42  principalTable: "Instances",
43  principalColumn: "Id",
44  onDelete: ReferentialAction.Cascade);
45  }
46 
51  protected override void Down(MigrationBuilder migrationBuilder)
52  {
53  if (migrationBuilder == null)
54  throw new ArgumentNullException(nameof(migrationBuilder));
55 
56  migrationBuilder.DropForeignKey(
57  name: "FK_RevisionInformations_Instances_InstanceId",
58  table: "RevisionInformations");
59 
60  migrationBuilder.DropIndex(
61  name: "IX_RevisionInformations_InstanceId_CommitSha",
62  table: "RevisionInformations");
63 
64  migrationBuilder.CreateIndex(
65  name: "IX_RevisionInformations_CommitSha",
66  table: "RevisionInformations",
67  column: "CommitSha",
68  unique: true);
69 
70  migrationBuilder.CreateIndex(
71  name: "IX_RevisionInformations_InstanceId",
72  table: "RevisionInformations",
73  column: "InstanceId");
74 
75  migrationBuilder.AddForeignKey(
76  name: "FK_RevisionInformations_Instances_InstanceId",
77  table: "RevisionInformations",
78  column: "InstanceId",
79  principalTable: "Instances",
80  principalColumn: "Id",
81  onDelete: ReferentialAction.Cascade);
82  }
83  }
84 }
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
+ -
override void Up(MigrationBuilder migrationBuilder)
Applies the migration
-
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
- + +
override void Down(MigrationBuilder migrationBuilder)
Unapplies the migration
diff --git a/_application_8cs_source.html b/_application_8cs_source.html index fbe933899c..2a48858f4a 100644 --- a/_application_8cs_source.html +++ b/_application_8cs_source.html @@ -71,7 +71,7 @@ $(function() {
Application.cs
-Go to the documentation of this file.
1 using Byond.TopicSender;
2 using Cyberboss.AspNetCore.AsyncInitializer;
3 using Microsoft.AspNetCore.Authentication.JwtBearer;
4 using Microsoft.AspNetCore.Builder;
5 using Microsoft.AspNetCore.Cors.Infrastructure;
6 using Microsoft.AspNetCore.Hosting;
7 using Microsoft.AspNetCore.Identity;
8 using Microsoft.AspNetCore.Mvc;
9 using Microsoft.Extensions.Configuration;
10 using Microsoft.Extensions.DependencyInjection;
11 using Microsoft.Extensions.Hosting;
12 using Microsoft.Extensions.Logging;
13 using Microsoft.Extensions.Options;
14 using Microsoft.Extensions.Primitives;
15 using Newtonsoft.Json;
16 using Newtonsoft.Json.Converters;
17 using Serilog;
18 using Serilog.Events;
19 using Serilog.Formatting.Display;
20 using System;
21 using System.Globalization;
22 using System.IdentityModel.Tokens.Jwt;
23 using System.Linq;
24 using System.Threading.Tasks;
25 using Tgstation.Server.Api;
34 using Tgstation.Server.Host.IO;
38 
40 {
42 #pragma warning disable CA1506
43  sealed class Application : IApplication
44  {
46  public string VersionPrefix => "tgstation-server";
47 
49  public Version Version { get; }
50 
52  public string VersionString { get; }
53 
57  readonly IConfiguration configuration;
58 
63 
68 
72  readonly Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment;
73 
77  readonly TaskCompletionSource<object> startupTcs;
78 
83 
91  public Application(
92  IConfiguration configuration,
94  Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment,
96  {
97  this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
98  this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider));
99  this.hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment));
100  this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
101 
102  startupTcs = new TaskCompletionSource<object>();
103 
105  VersionString = String.Format(CultureInfo.InvariantCulture, "{0} v{1}", VersionPrefix, Version);
106  }
107 
112  public void ConfigureServices(IServiceCollection services)
113  {
114  if (services == null)
115  throw new ArgumentNullException(nameof(services));
116 
117  // needful
118  services.AddSingleton<IApplication>(this);
119 
120  // configure configuration
121  services.UseStandardConfig<UpdatesConfiguration>(configuration);
122  services.UseStandardConfig<DatabaseConfiguration>(configuration);
123  services.UseStandardConfig<GeneralConfiguration>(configuration);
124  services.UseStandardConfig<FileLoggingConfiguration>(configuration);
125  services.UseStandardConfig<ControlPanelConfiguration>(configuration);
126 
127  // enable options which give us config reloading
128  services.AddOptions();
129 
130  // this is needful for the setup wizard
131  services.AddLogging();
132 
133  // other stuff needed for for setup wizard and configuration
134  services.AddSingleton<IConsole, IO.Console>();
135  services.AddSingleton<IDatabaseConnectionFactory, DatabaseConnectionFactory>();
136  services.AddSingleton<ISetupWizard, SetupWizard>();
137  services.AddSingleton<IPlatformIdentifier, PlatformIdentifier>();
138  services.AddSingleton<IAsyncDelayer, AsyncDelayer>();
139 
140  GeneralConfiguration generalConfiguration;
141  DatabaseConfiguration databaseConfiguration;
142  FileLoggingConfiguration fileLoggingConfiguration;
143  ControlPanelConfiguration controlPanelConfiguration;
144  IPlatformIdentifier platformIdentifier;
145 
146  // temporarily build the service provider in it's current state
147  // do it here so we can run the setup wizard if necessary
148  // also allows us to get some options and other services we need for continued configuration
149  using (var provider = services.BuildServiceProvider())
150  {
151  // run the wizard if necessary
152  var setupWizard = provider.GetRequiredService<ISetupWizard>();
153  var applicationLifetime = provider.GetRequiredService<Microsoft.AspNetCore.Hosting.IApplicationLifetime>();
154  var setupWizardRan = setupWizard.CheckRunWizard(applicationLifetime.ApplicationStopping).GetAwaiter().GetResult();
155 
156  // load the configuration options we need
157  var generalOptions = provider.GetRequiredService<IOptions<GeneralConfiguration>>();
158  generalConfiguration = generalOptions.Value;
159 
160  // unless this is set, in which case, we leave
161  if (setupWizardRan && generalConfiguration.SetupWizardMode == SetupWizardMode.Only)
162  throw new OperationCanceledException("Exiting due to SetupWizardMode configuration!"); // we don't inject a logger in the constuctor to log this because it's not yet configured
163 
164  var dbOptions = provider.GetRequiredService<IOptions<DatabaseConfiguration>>();
165  databaseConfiguration = dbOptions.Value;
166 
167  var loggingOptions = provider.GetRequiredService<IOptions<FileLoggingConfiguration>>();
168  fileLoggingConfiguration = loggingOptions.Value;
169 
170  var controlPanelOptions = provider.GetRequiredService<IOptions<ControlPanelConfiguration>>();
171  controlPanelConfiguration = controlPanelOptions.Value;
172 
173  platformIdentifier = provider.GetRequiredService<IPlatformIdentifier>();
174  }
175 
176  // setup file logging via serilog
177  if (!fileLoggingConfiguration.Disable)
178  services.AddLogging(builder =>
179  {
180  // common app data is C:/ProgramData on windows, else /usr/shar
181  var logPath = !String.IsNullOrEmpty(fileLoggingConfiguration.Directory) ? fileLoggingConfiguration.Directory : ioManager.ConcatPath(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), VersionPrefix, "Logs");
182 
183  logPath = ioManager.ConcatPath(logPath, "tgs-{Date}.log");
184 
185  LogEventLevel? ConvertLogLevel(LogLevel logLevel)
186  {
187  switch (logLevel)
188  {
189  case LogLevel.Critical:
190  return LogEventLevel.Fatal;
191  case LogLevel.Debug:
192  return LogEventLevel.Debug;
193  case LogLevel.Error:
194  return LogEventLevel.Error;
195  case LogLevel.Information:
196  return LogEventLevel.Information;
197  case LogLevel.Trace:
198  return LogEventLevel.Verbose;
199  case LogLevel.Warning:
200  return LogEventLevel.Warning;
201  case LogLevel.None:
202  return null;
203  default:
204  throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "Invalid log level {0}", logLevel));
205  }
206  }
207 
208  var logEventLevel = ConvertLogLevel(fileLoggingConfiguration.LogLevel);
209  var microsoftEventLevel = ConvertLogLevel(fileLoggingConfiguration.MicrosoftLogLevel);
210 
211  var formatter = new MessageTemplateTextFormatter("{Timestamp:o} {RequestId,13} [{Level:u3}] {SourceContext:l}: {Message} ({EventId:x8}){NewLine}{Exception}", null);
212 
213  var configuration = new LoggerConfiguration()
214  .Enrich.FromLogContext()
215  .WriteTo.Async(w => w.RollingFile(formatter, logPath, shared: true, flushToDiskInterval: TimeSpan.FromSeconds(2)));
216 
217  if (logEventLevel.HasValue)
218  configuration.MinimumLevel.Is(logEventLevel.Value);
219 
220  if (microsoftEventLevel.HasValue)
221  configuration.MinimumLevel.Override("Microsoft", microsoftEventLevel.Value);
222 
223  builder.AddSerilog(configuration.CreateLogger(), true);
224  });
225 
226  // configure bearer token validation
227  services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(jwtBearerOptions =>
228  {
229  // this line isn't actually run until the first request is made
230  // at that point tokenFactory will be populated
231  jwtBearerOptions.TokenValidationParameters = tokenFactory.ValidationParameters;
232  jwtBearerOptions.Events = new JwtBearerEvents
233  {
234  // Application is our composition root so this monstrosity of a line is okay
235  OnTokenValidated = ctx => ctx.HttpContext.RequestServices.GetRequiredService<IClaimsInjector>().InjectClaimsIntoContext(ctx, ctx.HttpContext.RequestAborted)
236  };
237  });
238 
239  // fucking prevents converting 'sub' to M$ bs
240  // can't be done in the above lambda, that's too late
241  JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
242 
243  // add mvc, configure the json serializer settings
244  services
245  .AddMvc(options =>
246  {
247  var dataAnnotationValidator = options.ModelValidatorProviders.Single(validator => validator.GetType().Name == "DataAnnotationsModelValidatorProvider");
248  options.ModelValidatorProviders.Remove(dataAnnotationValidator);
249  })
250  .SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
251  .AddJsonOptions(options =>
252  {
253  options.AllowInputFormatterExceptionMessages = true;
254  options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
255  options.SerializerSettings.CheckAdditionalContent = true;
256  options.SerializerSettings.MissingMemberHandling = MissingMemberHandling.Error;
257  options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
258  options.SerializerSettings.Converters = new[] { new VersionConverter() };
259  });
260 
261  if (hostingEnvironment.IsDevelopment())
262  {
263  string GetDocumentationFilePath(string assemblyLocation) => ioManager.ConcatPath(ioManager.GetDirectoryName(assemblyLocation), String.Concat(ioManager.GetFileNameWithoutExtension(assemblyLocation), ".xml"));
264  var assemblyDocumentationPath = GetDocumentationFilePath(assemblyInformationProvider.Path);
265  var apiDocumentationPath = GetDocumentationFilePath(typeof(ApiHeaders).Assembly.Location);
266  services.AddSwaggerGen(genOptions => SwaggerConfiguration.Configure(genOptions, assemblyDocumentationPath, apiDocumentationPath));
267  }
268 
269  // enable browser detection
270  services.AddDetectionCore().AddBrowser();
271 
272  // CORS conditionally enabled later
273  services.AddCors();
274 
275  void AddTypedContext<TContext>() where TContext : DatabaseContext<TContext>
276  {
277  services.AddDbContext<TContext>(builder =>
278  {
279  if (hostingEnvironment.IsDevelopment())
280  builder.EnableSensitiveDataLogging();
281  });
282  services.AddScoped<IDatabaseContext>(x => x.GetRequiredService<TContext>());
283  }
284 
285  // add the correct database context type
286  var dbType = databaseConfiguration.DatabaseType;
287  switch (dbType)
288  {
289  case DatabaseType.MySql:
290  case DatabaseType.MariaDB:
291  AddTypedContext<MySqlDatabaseContext>();
292  break;
293  case DatabaseType.SqlServer:
294  AddTypedContext<SqlServerDatabaseContext>();
295  break;
296  default:
297  throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "Invalid {0}: {1}!", nameof(DatabaseType), dbType));
298  }
299 
300  // configure other database services
301  services.AddSingleton<IDatabaseContextFactory, DatabaseContextFactory>();
302  services.AddSingleton<IDatabaseSeeder, DatabaseSeeder>();
303 
304  // configure security services
306  services.AddScoped<IClaimsInjector, ClaimsInjector>();
307  services.AddSingleton<IIdentityCache, IdentityCache>();
308  services.AddSingleton<ICryptographySuite, CryptographySuite>();
309  services.AddSingleton<ITokenFactory, TokenFactory>();
310  services.AddSingleton<IPasswordHasher<Models.User>, PasswordHasher<Models.User>>();
311 
312  // configure platform specific services
313  if (platformIdentifier.IsWindows)
314  {
315  if (generalConfiguration.UseBasicWatchdogOnWindows)
316  services.AddSingleton<IWatchdogFactory, WatchdogFactory>();
317  else
318  services.AddSingleton<IWatchdogFactory, WindowsWatchdogFactory>();
319 
320  services.AddSingleton<ISystemIdentityFactory, WindowsSystemIdentityFactory>();
321  services.AddSingleton<ISymlinkFactory, WindowsSymlinkFactory>();
322  services.AddSingleton<IByondInstaller, WindowsByondInstaller>();
323  services.AddSingleton<IPostWriteHandler, WindowsPostWriteHandler>();
324 
325  services.AddSingleton<WindowsNetworkPromptReaper>();
326  services.AddSingleton<INetworkPromptReaper>(x => x.GetRequiredService<WindowsNetworkPromptReaper>());
327  services.AddSingleton<IHostedService>(x => x.GetRequiredService<WindowsNetworkPromptReaper>());
328  }
329  else
330  {
331  services.AddSingleton<IWatchdogFactory, WatchdogFactory>();
332  services.AddSingleton<ISystemIdentityFactory, PosixSystemIdentityFactory>();
333  services.AddSingleton<ISymlinkFactory, PosixSymlinkFactory>();
334  services.AddSingleton<IByondInstaller, PosixByondInstaller>();
335  services.AddSingleton<IPostWriteHandler, PosixPostWriteHandler>();
336  services.AddSingleton<INetworkPromptReaper, PosixNetworkPromptReaper>();
337  }
338 
339  // configure misc services
340  services.AddSingleton<ISynchronousIOManager, SynchronousIOManager>();
341  services.AddSingleton<IGitHubClientFactory, GitHubClientFactory>();
342  services.AddSingleton<IProcessExecutor, ProcessExecutor>();
343  services.AddSingleton<IByondTopicSender>(new ByondTopicSender
344  {
345  ReceiveTimeout = generalConfiguration.ByondTopicTimeout,
346  SendTimeout = generalConfiguration.ByondTopicTimeout
347  });
348 
349  // configure component services
350  services.AddSingleton<ICredentialsProvider, CredentialsProvider>();
351  services.AddSingleton<IProviderFactory, ProviderFactory>();
352  services.AddSingleton<IChatFactory, ChatFactory>();
353  services.AddSingleton<IInstanceFactory, InstanceFactory>();
354 
355  // configure root services
356  services.AddSingleton<InstanceManager>();
357  services.AddSingleton<IInstanceManager>(x => x.GetRequiredService<InstanceManager>());
358  services.AddSingleton<IHostedService>(x => x.GetRequiredService<InstanceManager>());
359 
360  services.AddSingleton<IJobManager, JobManager>();
361  }
362 
371  public void Configure(IApplicationBuilder applicationBuilder, IServerControl serverControl, ITokenFactory tokenFactory, IOptions<ControlPanelConfiguration> controlPanelConfigurationOptions, ILogger<Application> logger)
372  {
373  if (applicationBuilder == null)
374  throw new ArgumentNullException(nameof(applicationBuilder));
375  if (serverControl == null)
376  throw new ArgumentNullException(nameof(serverControl));
377 
378  this.tokenFactory = tokenFactory ?? throw new ArgumentNullException(nameof(tokenFactory));
379 
380  var controlPanelConfiguration = controlPanelConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(controlPanelConfigurationOptions));
381 
382  if (logger == null)
383  throw new ArgumentNullException(nameof(logger));
384 
385  logger.LogInformation(VersionString);
386  logger.LogDebug("Content Root: {0}", hostingEnvironment.ContentRootPath);
387  logger.LogTrace("Web Root: {0}", hostingEnvironment.WebRootPath);
388 
389  // attempt to restart the server if the configuration changes
390  if (serverControl.WatchdogPresent)
391  ChangeToken.OnChange(configuration.GetReloadToken, () => serverControl.Restart());
392 
393  // setup the HTTP request pipeline
394  // Final point where we wrap exceptions in a 500 (ErrorMessage) response
395  applicationBuilder.UseServerErrorHandling();
396 
397  // should anything after this throw an exception, catch it and display a detailed html page
398  if (hostingEnvironment.IsDevelopment())
399  applicationBuilder.UseDeveloperExceptionPage(); // it is not worth it to limit this, you should only ever get it if you're an authorized user
400 
401  // suppress OperationCancelledExceptions, they are just aborted HTTP requests
402  applicationBuilder.UseCancelledRequestSuppression();
403 
404  if (hostingEnvironment.IsDevelopment())
405  {
406  applicationBuilder.UseSwagger();
407  applicationBuilder.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "TGS API V4"));
408  }
409 
410  // Set up CORS based on configuration if necessary
411  Action<CorsPolicyBuilder> corsBuilder = null;
412  if (controlPanelConfiguration.AllowAnyOrigin)
413  {
414  logger.LogTrace("Access-Control-Allow-Origin: *");
415  corsBuilder = builder => builder.AllowAnyOrigin();
416  }
417  else if (controlPanelConfiguration.AllowedOrigins?.Count > 0)
418  {
419  logger.LogTrace("Access-Control-Allow-Origin: ", String.Join(',', controlPanelConfiguration.AllowedOrigins));
420  corsBuilder = builder => builder.WithOrigins(controlPanelConfiguration.AllowedOrigins.ToArray());
421  }
422 
423  var originalBuilder = corsBuilder;
424  corsBuilder = builder =>
425  {
426  builder.AllowAnyHeader().AllowAnyMethod();
427  originalBuilder?.Invoke(builder);
428  };
429  applicationBuilder.UseCors(corsBuilder);
430 
431  // Do not service requests until Ready is called, this will return 503 until that point
432  applicationBuilder.UseAsyncInitialization(async cancellationToken =>
433  {
434  using (cancellationToken.Register(() => startupTcs.SetCanceled()))
435  await startupTcs.Task.ConfigureAwait(false);
436  });
437 
438  // spa loading if necessary
439  if (controlPanelConfiguration.Enable)
440  {
441  logger.LogWarning("Web control panel enabled. This is a highly WIP feature!");
442  applicationBuilder.UseStaticFiles();
443  }
444  else
445  logger.LogDebug("Web control panel disabled!");
446 
447  // authenticate JWT tokens using our security pipeline if present, returns 401 if bad
448  applicationBuilder.UseAuthentication();
449 
450  // suppress and log database exceptions
451  applicationBuilder.UseDbConflictHandling();
452 
453  // majority of handling is done in the controllers
454  applicationBuilder.UseMvc();
455 
456  // 404 anything that gets this far
457  }
458 
460  public void Ready(Exception initializationError)
461  {
462  lock (startupTcs)
463  {
464  if (startupTcs.Task.IsCompleted)
465  throw new InvalidOperationException("Ready has already been called!");
466  if (initializationError == null)
467  startupTcs.SetResult(null);
468  else
469  startupTcs.SetException(initializationError);
470  }
471  }
472  }
473 }
LogLevel MicrosoftLogLevel
The minimum Microsoft.Extensions.Logging.LogLevel to display in logs for Microsoft library sources
+Go to the documentation of this file.
1 using Byond.TopicSender;
2 using Cyberboss.AspNetCore.AsyncInitializer;
3 using Microsoft.AspNetCore.Authentication.JwtBearer;
4 using Microsoft.AspNetCore.Builder;
5 using Microsoft.AspNetCore.Cors.Infrastructure;
6 using Microsoft.AspNetCore.Hosting;
7 using Microsoft.AspNetCore.Identity;
8 using Microsoft.AspNetCore.Mvc;
9 using Microsoft.Extensions.Configuration;
10 using Microsoft.Extensions.DependencyInjection;
11 using Microsoft.Extensions.Hosting;
12 using Microsoft.Extensions.Logging;
13 using Microsoft.Extensions.Options;
14 using Microsoft.Extensions.Primitives;
15 using Newtonsoft.Json;
16 using Newtonsoft.Json.Converters;
17 using Serilog;
18 using Serilog.Events;
19 using Serilog.Formatting.Display;
20 using System;
21 using System.Globalization;
22 using System.IdentityModel.Tokens.Jwt;
23 using System.Linq;
24 using System.Threading.Tasks;
25 using Tgstation.Server.Api;
34 using Tgstation.Server.Host.IO;
38 
40 {
42 #pragma warning disable CA1506
43  sealed class Application : IApplication
44  {
46  public string VersionPrefix => "tgstation-server";
47 
49  public Version Version { get; }
50 
52  public string VersionString { get; }
53 
57  readonly IConfiguration configuration;
58 
63 
68 
72  readonly Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment;
73 
77  readonly TaskCompletionSource<object> startupTcs;
78 
83 
91  public Application(
92  IConfiguration configuration,
94  Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment,
96  {
97  this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
98  this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider));
99  this.hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment));
100  this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
101 
102  startupTcs = new TaskCompletionSource<object>();
103 
105  VersionString = String.Format(CultureInfo.InvariantCulture, "{0} v{1}", VersionPrefix, Version);
106  }
107 
112  public void ConfigureServices(IServiceCollection services)
113  {
114  if (services == null)
115  throw new ArgumentNullException(nameof(services));
116 
117  // needful
118  services.AddSingleton<IApplication>(this);
119 
120  // configure configuration
121  services.UseStandardConfig<UpdatesConfiguration>(configuration);
122  services.UseStandardConfig<DatabaseConfiguration>(configuration);
123  services.UseStandardConfig<GeneralConfiguration>(configuration);
124  services.UseStandardConfig<FileLoggingConfiguration>(configuration);
125  services.UseStandardConfig<ControlPanelConfiguration>(configuration);
126 
127  // enable options which give us config reloading
128  services.AddOptions();
129 
130  // this is needful for the setup wizard
131  services.AddLogging();
132 
133  // other stuff needed for for setup wizard and configuration
134  services.AddSingleton<IConsole, IO.Console>();
135  services.AddSingleton<IDatabaseConnectionFactory, DatabaseConnectionFactory>();
136  services.AddSingleton<ISetupWizard, SetupWizard>();
137  services.AddSingleton<IPlatformIdentifier, PlatformIdentifier>();
138  services.AddSingleton<IAsyncDelayer, AsyncDelayer>();
139 
140  GeneralConfiguration generalConfiguration;
141  DatabaseConfiguration databaseConfiguration;
142  FileLoggingConfiguration fileLoggingConfiguration;
143  ControlPanelConfiguration controlPanelConfiguration;
144  IPlatformIdentifier platformIdentifier;
145 
146  // temporarily build the service provider in it's current state
147  // do it here so we can run the setup wizard if necessary
148  // also allows us to get some options and other services we need for continued configuration
149  using (var provider = services.BuildServiceProvider())
150  {
151  // run the wizard if necessary
152  var setupWizard = provider.GetRequiredService<ISetupWizard>();
153  var applicationLifetime = provider.GetRequiredService<Microsoft.AspNetCore.Hosting.IApplicationLifetime>();
154  var setupWizardRan = setupWizard.CheckRunWizard(applicationLifetime.ApplicationStopping).GetAwaiter().GetResult();
155 
156  // load the configuration options we need
157  var generalOptions = provider.GetRequiredService<IOptions<GeneralConfiguration>>();
158  generalConfiguration = generalOptions.Value;
159 
160  // unless this is set, in which case, we leave
161  if (setupWizardRan && generalConfiguration.SetupWizardMode == SetupWizardMode.Only)
162  throw new OperationCanceledException("Exiting due to SetupWizardMode configuration!"); // we don't inject a logger in the constuctor to log this because it's not yet configured
163 
164  var dbOptions = provider.GetRequiredService<IOptions<DatabaseConfiguration>>();
165  databaseConfiguration = dbOptions.Value;
166 
167  var loggingOptions = provider.GetRequiredService<IOptions<FileLoggingConfiguration>>();
168  fileLoggingConfiguration = loggingOptions.Value;
169 
170  var controlPanelOptions = provider.GetRequiredService<IOptions<ControlPanelConfiguration>>();
171  controlPanelConfiguration = controlPanelOptions.Value;
172 
173  platformIdentifier = provider.GetRequiredService<IPlatformIdentifier>();
174  }
175 
176  // setup file logging via serilog
177  if (!fileLoggingConfiguration.Disable)
178  services.AddLogging(builder =>
179  {
180  // common app data is C:/ProgramData on windows, else /usr/shar
181  var logPath = !String.IsNullOrEmpty(fileLoggingConfiguration.Directory) ? fileLoggingConfiguration.Directory : ioManager.ConcatPath(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), VersionPrefix, "Logs");
182 
183  logPath = ioManager.ConcatPath(logPath, "tgs-{Date}.log");
184 
185  LogEventLevel? ConvertLogLevel(LogLevel logLevel)
186  {
187  switch (logLevel)
188  {
189  case LogLevel.Critical:
190  return LogEventLevel.Fatal;
191  case LogLevel.Debug:
192  return LogEventLevel.Debug;
193  case LogLevel.Error:
194  return LogEventLevel.Error;
195  case LogLevel.Information:
196  return LogEventLevel.Information;
197  case LogLevel.Trace:
198  return LogEventLevel.Verbose;
199  case LogLevel.Warning:
200  return LogEventLevel.Warning;
201  case LogLevel.None:
202  return null;
203  default:
204  throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "Invalid log level {0}", logLevel));
205  }
206  }
207 
208  var logEventLevel = ConvertLogLevel(fileLoggingConfiguration.LogLevel);
209  var microsoftEventLevel = ConvertLogLevel(fileLoggingConfiguration.MicrosoftLogLevel);
210 
211  var formatter = new MessageTemplateTextFormatter("{Timestamp:o} {RequestId,13} [{Level:u3}] {SourceContext:l}: {Message} ({EventId:x8}){NewLine}{Exception}", null);
212 
213  var configuration = new LoggerConfiguration()
214  .Enrich.FromLogContext()
215  .WriteTo.Async(w => w.RollingFile(formatter, logPath, shared: true, flushToDiskInterval: TimeSpan.FromSeconds(2)));
216 
217  if (logEventLevel.HasValue)
218  configuration.MinimumLevel.Is(logEventLevel.Value);
219 
220  if (microsoftEventLevel.HasValue)
221  configuration.MinimumLevel.Override("Microsoft", microsoftEventLevel.Value);
222 
223  builder.AddSerilog(configuration.CreateLogger(), true);
224  });
225 
226  // configure bearer token validation
227  services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(jwtBearerOptions =>
228  {
229  // this line isn't actually run until the first request is made
230  // at that point tokenFactory will be populated
231  jwtBearerOptions.TokenValidationParameters = tokenFactory.ValidationParameters;
232  jwtBearerOptions.Events = new JwtBearerEvents
233  {
234  // Application is our composition root so this monstrosity of a line is okay
235  OnTokenValidated = ctx => ctx.HttpContext.RequestServices.GetRequiredService<IClaimsInjector>().InjectClaimsIntoContext(ctx, ctx.HttpContext.RequestAborted)
236  };
237  });
238 
239  // fucking prevents converting 'sub' to M$ bs
240  // can't be done in the above lambda, that's too late
241  JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
242 
243  // add mvc, configure the json serializer settings
244  services
245  .AddMvc(options =>
246  {
247  var dataAnnotationValidator = options.ModelValidatorProviders.Single(validator => validator.GetType().Name == "DataAnnotationsModelValidatorProvider");
248  options.ModelValidatorProviders.Remove(dataAnnotationValidator);
249  })
250  .SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
251  .AddJsonOptions(options =>
252  {
253  options.AllowInputFormatterExceptionMessages = true;
254  options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
255  options.SerializerSettings.CheckAdditionalContent = true;
256  options.SerializerSettings.MissingMemberHandling = MissingMemberHandling.Error;
257  options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
258  options.SerializerSettings.Converters = new[] { new VersionConverter() };
259  });
260 
261  if (hostingEnvironment.IsDevelopment())
262  {
263  string GetDocumentationFilePath(string assemblyLocation) => ioManager.ConcatPath(ioManager.GetDirectoryName(assemblyLocation), String.Concat(ioManager.GetFileNameWithoutExtension(assemblyLocation), ".xml"));
264  var assemblyDocumentationPath = GetDocumentationFilePath(assemblyInformationProvider.Path);
265  var apiDocumentationPath = GetDocumentationFilePath(typeof(ApiHeaders).Assembly.Location);
266  services.AddSwaggerGen(genOptions => SwaggerConfiguration.Configure(genOptions, assemblyDocumentationPath, apiDocumentationPath));
267  }
268 
269  // enable browser detection
270  services.AddDetectionCore().AddBrowser();
271 
272  // CORS conditionally enabled later
273  services.AddCors();
274 
275  void AddTypedContext<TContext>() where TContext : DatabaseContext<TContext>
276  {
277  services.AddDbContext<TContext>(builder =>
278  {
279  if (hostingEnvironment.IsDevelopment())
280  builder.EnableSensitiveDataLogging();
281  });
282  services.AddScoped<IDatabaseContext>(x => x.GetRequiredService<TContext>());
283  }
284 
285  // add the correct database context type
286  var dbType = databaseConfiguration.DatabaseType;
287  switch (dbType)
288  {
289  case DatabaseType.MySql:
290  case DatabaseType.MariaDB:
291  AddTypedContext<MySqlDatabaseContext>();
292  break;
293  case DatabaseType.SqlServer:
294  AddTypedContext<SqlServerDatabaseContext>();
295  break;
296  case DatabaseType.Sqlite:
297  AddTypedContext<SqliteDatabaseContext>();
298  break;
299  default:
300  throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "Invalid {0}: {1}!", nameof(DatabaseType), dbType));
301  }
302 
303  // configure other database services
304  services.AddSingleton<IDatabaseContextFactory, DatabaseContextFactory>();
305  services.AddSingleton<IDatabaseSeeder, DatabaseSeeder>();
306 
307  // configure security services
309  services.AddScoped<IClaimsInjector, ClaimsInjector>();
310  services.AddSingleton<IIdentityCache, IdentityCache>();
311  services.AddSingleton<ICryptographySuite, CryptographySuite>();
312  services.AddSingleton<ITokenFactory, TokenFactory>();
313  services.AddSingleton<IPasswordHasher<Models.User>, PasswordHasher<Models.User>>();
314 
315  // configure platform specific services
316  if (platformIdentifier.IsWindows)
317  {
318  if (generalConfiguration.UseBasicWatchdogOnWindows)
319  services.AddSingleton<IWatchdogFactory, WatchdogFactory>();
320  else
321  services.AddSingleton<IWatchdogFactory, WindowsWatchdogFactory>();
322 
323  services.AddSingleton<ISystemIdentityFactory, WindowsSystemIdentityFactory>();
324  services.AddSingleton<ISymlinkFactory, WindowsSymlinkFactory>();
325  services.AddSingleton<IByondInstaller, WindowsByondInstaller>();
326  services.AddSingleton<IPostWriteHandler, WindowsPostWriteHandler>();
327 
328  services.AddSingleton<WindowsNetworkPromptReaper>();
329  services.AddSingleton<INetworkPromptReaper>(x => x.GetRequiredService<WindowsNetworkPromptReaper>());
330  services.AddSingleton<IHostedService>(x => x.GetRequiredService<WindowsNetworkPromptReaper>());
331  }
332  else
333  {
334  services.AddSingleton<IWatchdogFactory, WatchdogFactory>();
335  services.AddSingleton<ISystemIdentityFactory, PosixSystemIdentityFactory>();
336  services.AddSingleton<ISymlinkFactory, PosixSymlinkFactory>();
337  services.AddSingleton<IByondInstaller, PosixByondInstaller>();
338  services.AddSingleton<IPostWriteHandler, PosixPostWriteHandler>();
339  services.AddSingleton<INetworkPromptReaper, PosixNetworkPromptReaper>();
340  }
341 
342  // configure misc services
343  services.AddSingleton<ISynchronousIOManager, SynchronousIOManager>();
344  services.AddSingleton<IGitHubClientFactory, GitHubClientFactory>();
345  services.AddSingleton<IProcessExecutor, ProcessExecutor>();
346  services.AddSingleton<IByondTopicSender>(new ByondTopicSender
347  {
348  ReceiveTimeout = generalConfiguration.ByondTopicTimeout,
349  SendTimeout = generalConfiguration.ByondTopicTimeout
350  });
351 
352  // configure component services
353  services.AddSingleton<ICredentialsProvider, CredentialsProvider>();
354  services.AddSingleton<IProviderFactory, ProviderFactory>();
355  services.AddSingleton<IChatFactory, ChatFactory>();
356  services.AddSingleton<IInstanceFactory, InstanceFactory>();
357 
358  // configure root services
359  services.AddSingleton<InstanceManager>();
360  services.AddSingleton<IInstanceManager>(x => x.GetRequiredService<InstanceManager>());
361  services.AddSingleton<IHostedService>(x => x.GetRequiredService<InstanceManager>());
362 
363  services.AddSingleton<IJobManager, JobManager>();
364  }
365 
374  public void Configure(IApplicationBuilder applicationBuilder, IServerControl serverControl, ITokenFactory tokenFactory, IOptions<ControlPanelConfiguration> controlPanelConfigurationOptions, ILogger<Application> logger)
375  {
376  if (applicationBuilder == null)
377  throw new ArgumentNullException(nameof(applicationBuilder));
378  if (serverControl == null)
379  throw new ArgumentNullException(nameof(serverControl));
380 
381  this.tokenFactory = tokenFactory ?? throw new ArgumentNullException(nameof(tokenFactory));
382 
383  var controlPanelConfiguration = controlPanelConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(controlPanelConfigurationOptions));
384 
385  if (logger == null)
386  throw new ArgumentNullException(nameof(logger));
387 
388  logger.LogInformation(VersionString);
389  logger.LogDebug("Content Root: {0}", hostingEnvironment.ContentRootPath);
390  logger.LogTrace("Web Root: {0}", hostingEnvironment.WebRootPath);
391 
392  // attempt to restart the server if the configuration changes
393  if (serverControl.WatchdogPresent)
394  ChangeToken.OnChange(configuration.GetReloadToken, () => serverControl.Restart());
395 
396  // setup the HTTP request pipeline
397  // Final point where we wrap exceptions in a 500 (ErrorMessage) response
398  applicationBuilder.UseServerErrorHandling();
399 
400  // should anything after this throw an exception, catch it and display a detailed html page
401  if (hostingEnvironment.IsDevelopment())
402  applicationBuilder.UseDeveloperExceptionPage(); // it is not worth it to limit this, you should only ever get it if you're an authorized user
403 
404  // suppress OperationCancelledExceptions, they are just aborted HTTP requests
405  applicationBuilder.UseCancelledRequestSuppression();
406 
407  if (hostingEnvironment.IsDevelopment())
408  {
409  applicationBuilder.UseSwagger();
410  applicationBuilder.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "TGS API V4"));
411  }
412 
413  // Set up CORS based on configuration if necessary
414  Action<CorsPolicyBuilder> corsBuilder = null;
415  if (controlPanelConfiguration.AllowAnyOrigin)
416  {
417  logger.LogTrace("Access-Control-Allow-Origin: *");
418  corsBuilder = builder => builder.AllowAnyOrigin();
419  }
420  else if (controlPanelConfiguration.AllowedOrigins?.Count > 0)
421  {
422  logger.LogTrace("Access-Control-Allow-Origin: ", String.Join(',', controlPanelConfiguration.AllowedOrigins));
423  corsBuilder = builder => builder.WithOrigins(controlPanelConfiguration.AllowedOrigins.ToArray());
424  }
425 
426  var originalBuilder = corsBuilder;
427  corsBuilder = builder =>
428  {
429  builder.AllowAnyHeader().AllowAnyMethod();
430  originalBuilder?.Invoke(builder);
431  };
432  applicationBuilder.UseCors(corsBuilder);
433 
434  // Do not service requests until Ready is called, this will return 503 until that point
435  applicationBuilder.UseAsyncInitialization(async cancellationToken =>
436  {
437  using (cancellationToken.Register(() => startupTcs.SetCanceled()))
438  await startupTcs.Task.ConfigureAwait(false);
439  });
440 
441  // spa loading if necessary
442  if (controlPanelConfiguration.Enable)
443  {
444  logger.LogWarning("Web control panel enabled. This is a highly WIP feature!");
445  applicationBuilder.UseStaticFiles();
446  }
447  else
448  logger.LogDebug("Web control panel disabled!");
449 
450  // authenticate JWT tokens using our security pipeline if present, returns 401 if bad
451  applicationBuilder.UseAuthentication();
452 
453  // suppress and log database exceptions
454  applicationBuilder.UseDbConflictHandling();
455 
456  // majority of handling is done in the controllers
457  applicationBuilder.UseMvc();
458 
459  // 404 anything that gets this far
460  }
461 
463  public void Ready(Exception initializationError)
464  {
465  lock (startupTcs)
466  {
467  if (startupTcs.Task.IsCompleted)
468  throw new InvalidOperationException("Ready has already been called!");
469  if (initializationError == null)
470  startupTcs.SetResult(null);
471  else
472  startupTcs.SetException(initializationError);
473  }
474  }
475  }
476 }
LogLevel MicrosoftLogLevel
The minimum Microsoft.Extensions.Logging.LogLevel to display in logs for Microsoft library sources
@@ -83,7 +83,7 @@ $(function() {
Handles changing file modes/permissions after writing
-
void Configure(IApplicationBuilder applicationBuilder, IServerControl serverControl, ITokenFactory tokenFactory, IOptions< ControlPanelConfiguration > controlPanelConfigurationOptions, ILogger< Application > logger)
Configure the Application
Definition: Application.cs:371
+
void Configure(IApplicationBuilder applicationBuilder, IServerControl serverControl, ITokenFactory tokenFactory, IOptions< ControlPanelConfiguration > controlPanelConfigurationOptions, ILogger< Application > logger)
Configure the Application
Definition: Application.cs:374
Configures the ASP.NET Core web application
Definition: IApplication.cs:8
@@ -130,7 +130,7 @@ $(function() { -
void Ready(Exception initializationError)
Mark the IApplication as ready to run
Definition: Application.cs:460
+
void Ready(Exception initializationError)
Mark the IApplication as ready to run
Definition: Application.cs:463
@@ -170,7 +170,7 @@ $(function() { - +
The command line Configuration setup wizard
Definition: ISetupWizard.cs:9
Task< bool > CheckRunWizard(CancellationToken cancellationToken)
Run the setup wizard if necessary
@@ -184,9 +184,9 @@ $(function() {
string ConcatPath(params string[] paths)
Combines an array of strings into a path
- + - +
Represents a service that may take an updated Host assembly and run it, stopping the current assembly...
diff --git a/_authentication_context_factory_8cs_source.html b/_authentication_context_factory_8cs_source.html index fbdb068289..db0878baeb 100644 --- a/_authentication_context_factory_8cs_source.html +++ b/_authentication_context_factory_8cs_source.html @@ -93,7 +93,7 @@ $(function() {
DbSet< InstanceUser > InstanceUsers
The InstanceUsers in the IDatabaseContext
- +
async Task CreateAuthenticationContext(long userId, long? instanceId, DateTimeOffset validAfter, CancellationToken cancellationToken)
Create an IAuthenticationContext to populate CurrentAuthenticationContext
diff --git a/_basic_watchdog_8cs_source.html b/_basic_watchdog_8cs_source.html index 5ade9309bb..6a6e46f5b3 100644 --- a/_basic_watchdog_8cs_source.html +++ b/_basic_watchdog_8cs_source.html @@ -141,7 +141,7 @@ $(function() {
static async Task< SemaphoreSlimContext > Lock(SemaphoreSlim semaphore, CancellationToken cancellationToken)
Asyncronously locks a semaphore
RebootState
Represents the action to take when /world/Reboot() is called
Definition: RebootState.cs:6
- + diff --git a/_byond_controller_8cs_source.html b/_byond_controller_8cs_source.html index 9b3cf72ab1..7a2d21ff78 100644 --- a/_byond_controller_8cs_source.html +++ b/_byond_controller_8cs_source.html @@ -108,7 +108,7 @@ $(function() {
Represents an error message returned by the server
Definition: ErrorMessage.cs:8
- +
Task< IActionResult > Read()
Gets the active Api.Models.Byond version.
diff --git a/_chat_controller_8cs_source.html b/_chat_controller_8cs_source.html index 1fe9823605..f70c4c12ea 100644 --- a/_chat_controller_8cs_source.html +++ b/_chat_controller_8cs_source.html @@ -112,7 +112,7 @@ $(function() {
async Task< IActionResult > GetId(long id, CancellationToken cancellationToken)
Get a specific Api.Models.ChatBot.
- +
diff --git a/_claims_injector_8cs_source.html b/_claims_injector_8cs_source.html index 3962877bf8..e89fa1a3df 100644 --- a/_claims_injector_8cs_source.html +++ b/_claims_injector_8cs_source.html @@ -92,7 +92,7 @@ $(function() {
IAuthenticationContext CurrentAuthenticationContext
The IAuthenticationContext the IAuthenticationContextFactory created
- +
static string RoleName(RightsType rightsType, Enum right)
Gets the role claim name used for a given rightsType and right
Definition: RightsHelper.cs:61
diff --git a/_command_factory_8cs_source.html b/_command_factory_8cs_source.html index a3b5d2d1bf..a119cb1452 100644 --- a/_command_factory_8cs_source.html +++ b/_command_factory_8cs_source.html @@ -98,7 +98,7 @@ $(function() {
readonly IApplication application
The IApplication for the CommandFactory
- +
readonly IRepositoryManager repositoryManager
The IRepositoryManager for the CommandFactory
Runs and monitors the twin server controllers
Definition: IWatchdog.cs:12
diff --git a/_components_2_watchdog_2_watchdog_factory_8cs_source.html b/_components_2_watchdog_2_watchdog_factory_8cs_source.html index f04eed7987..30211e346f 100644 --- a/_components_2_watchdog_2_watchdog_factory_8cs_source.html +++ b/_components_2_watchdog_2_watchdog_factory_8cs_source.html @@ -110,7 +110,7 @@ $(function() {
IByondTopicSender ByondTopicSender
The IByondTopicSender for the WatchdogFactory
Handles saving and loading WatchdogReattachInformation
- +
Runs and monitors the twin server controllers
Definition: IWatchdog.cs:12
Represents a service that may take an updated Host assembly and run it, stopping the current assembly...
diff --git a/_configuration_controller_8cs_source.html b/_configuration_controller_8cs_source.html index 33fa448b12..7963add94f 100644 --- a/_configuration_controller_8cs_source.html +++ b/_configuration_controller_8cs_source.html @@ -114,7 +114,7 @@ $(function() {
async Task< IActionResult > Directory(string directoryPath, CancellationToken cancellationToken)
Get the contents of a directory at a directoryPath
Represents an error message returned by the server
Definition: ErrorMessage.cs:8
- + diff --git a/_database_connection_factory_8cs_source.html b/_database_connection_factory_8cs_source.html index 28d3466ab1..903aff53f0 100644 --- a/_database_connection_factory_8cs_source.html +++ b/_database_connection_factory_8cs_source.html @@ -71,16 +71,16 @@ $(function() {
DatabaseConnectionFactory.cs
-Go to the documentation of this file.
1 using MySql.Data.MySqlClient;
2 using System;
3 using System.Data.Common;
4 using System.Data.SqlClient;
6 
8 {
11  {
13  public DbConnection CreateConnection(string connectionString, DatabaseType databaseType)
14  {
15  if (connectionString == null)
16  throw new ArgumentNullException(nameof(connectionString));
17 
18  switch (databaseType)
19  {
20  case DatabaseType.MariaDB:
21  case DatabaseType.MySql:
22  return new MySqlConnection
23  {
24  ConnectionString = connectionString
25  };
26  case DatabaseType.SqlServer:
27  return new SqlConnection
28  {
29  ConnectionString = connectionString
30  };
31  default:
32  throw new ArgumentOutOfRangeException(nameof(databaseType), databaseType, "Invalid DatabaseType!");
33  }
34  }
35  }
36 }
-
DbConnection CreateConnection(string connectionString, DatabaseType databaseType)
Create a DbConnection
+Go to the documentation of this file.
1 using System;
2 using System.Data.Common;
3 using System.Data.SqlClient;
4 using Microsoft.Data.Sqlite;
5 using MySql.Data.MySqlClient;
7 
9 {
12  {
14  public DbConnection CreateConnection(string connectionString, DatabaseType databaseType)
15  {
16  if (connectionString == null)
17  throw new ArgumentNullException(nameof(connectionString));
18 
19  switch (databaseType)
20  {
21  case DatabaseType.MariaDB:
22  case DatabaseType.MySql:
23  return new MySqlConnection
24  {
25  ConnectionString = connectionString
26  };
27  case DatabaseType.SqlServer:
28  return new SqlConnection
29  {
30  ConnectionString = connectionString
31  };
32  case DatabaseType.Sqlite:
33  return new SqliteConnection
34  {
35  ConnectionString = connectionString
36  };
37  default:
38  throw new ArgumentOutOfRangeException(nameof(databaseType), databaseType, "Invalid DatabaseType!");
39  }
40  }
41  }
42 }
+
DbConnection CreateConnection(string connectionString, DatabaseType databaseType)
Create a DbConnection
DatabaseType
Type of database to user
Definition: DatabaseType.cs:6
- + - +
-Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore;
2 using Microsoft.EntityFrameworkCore.Infrastructure;
3 using Microsoft.EntityFrameworkCore.Migrations;
4 using Microsoft.Extensions.DependencyInjection;
5 using Microsoft.Extensions.Logging;
6 using Microsoft.Extensions.Options;
7 using System;
8 using System.Globalization;
9 using System.Linq;
10 using System.Threading;
11 using System.Threading.Tasks;
15 
17 {
19  #pragma warning disable CA1506 // TODO: Decomplexify
20  abstract class DatabaseContext<TParentContext> : DbContext, IDatabaseContext where TParentContext : DbContext
21  {
23  public DbSet<User> Users { get; set; }
24 
26  public DbSet<Instance> Instances { get; set; }
27 
29  public DbSet<CompileJob> CompileJobs { get; set; }
30 
32  public DbSet<RevisionInformation> RevisionInformations { get; set; }
33 
35  public DbSet<DreamMakerSettings> DreamMakerSettings { get; set; }
36 
38  public DbSet<ChatBot> ChatBots { get; set; }
39 
41  public DbSet<DreamDaemonSettings> DreamDaemonSettings { get; set; }
42 
44  public DbSet<RepositorySettings> RepositorySettings { get; set; }
45 
47  public DbSet<InstanceUser> InstanceUsers { get; set; }
48 
50  public DbSet<ChatChannel> ChatChannels { get; set; }
51 
53  public DbSet<Job> Jobs { get; set; }
54 
56  public DbSet<ReattachInformation> ReattachInformations { get; set; }
57 
59  public DbSet<WatchdogReattachInformation> WatchdogReattachInformations { get; set; }
60 
64  public DbSet<TestMerge> TestMerges { get; set; }
65 
69  public DbSet<RevInfoTestMerge> RevInfoTestMerges { get; set; }
70 
74  protected ILogger Logger { get; }
75 
80 
85 
93  public DatabaseContext(DbContextOptions<TParentContext> dbContextOptions, IOptions<DatabaseConfiguration> databaseConfigurationOptions, IDatabaseSeeder databaseSeeder, ILogger logger) : base(dbContextOptions)
94  {
95  DatabaseConfiguration = databaseConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(databaseConfigurationOptions));
96  this.databaseSeeder = databaseSeeder ?? throw new ArgumentNullException(nameof(databaseSeeder));
97  Logger = logger ?? throw new ArgumentNullException(nameof(logger));
98  }
99 
101  protected override void OnModelCreating(ModelBuilder modelBuilder)
102  {
103  Logger.LogTrace("Building entity framework context...");
104  base.OnModelCreating(modelBuilder);
105 
106  var userModel = modelBuilder.Entity<User>();
107  userModel.HasIndex(x => x.CanonicalName).IsUnique();
108  userModel.HasMany(x => x.TestMerges).WithOne(x => x.MergedBy).OnDelete(DeleteBehavior.Restrict);
109 
110  modelBuilder.Entity<InstanceUser>().HasIndex(x => new { x.UserId, x.InstanceId }).IsUnique();
111 
112  modelBuilder.Entity<TestMerge>().HasMany(x => x.RevisonInformations).WithOne(x => x.TestMerge).OnDelete(DeleteBehavior.Cascade);
113 
114  var revInfo = modelBuilder.Entity<RevisionInformation>();
115  revInfo.HasMany(x => x.CompileJobs).WithOne(x => x.RevisionInformation).OnDelete(DeleteBehavior.Cascade);
116  revInfo.HasMany(x => x.ActiveTestMerges).WithOne(x => x.RevisionInformation).OnDelete(DeleteBehavior.Cascade);
117  revInfo.HasOne(x => x.PrimaryTestMerge).WithOne(x => x.PrimaryRevisionInformation).OnDelete(DeleteBehavior.Restrict);
118  revInfo.HasIndex(x => new { x.InstanceId, x.CommitSha }).IsUnique();
119 
120  modelBuilder.Entity<CompileJob>().HasIndex(x => x.DirectoryName);
121 
122  modelBuilder.Entity<Job>().HasOne<CompileJob>().WithOne(x => x.Job).OnDelete(DeleteBehavior.Restrict);
123 
124  var chatChannel = modelBuilder.Entity<ChatChannel>();
125  chatChannel.HasIndex(x => new { x.ChatSettingsId, x.IrcChannel }).IsUnique();
126  chatChannel.HasIndex(x => new { x.ChatSettingsId, x.DiscordChannelId }).IsUnique();
127  chatChannel.HasOne(x => x.ChatSettings).WithMany(x => x.Channels).HasForeignKey(x => x.ChatSettingsId).OnDelete(DeleteBehavior.Cascade);
128 
129  modelBuilder.Entity<ChatBot>().HasIndex(x => x.Name).IsUnique();
130 
131  var instanceModel = modelBuilder.Entity<Instance>();
132  instanceModel.HasIndex(x => x.Path).IsUnique();
133  instanceModel.HasMany(x => x.ChatSettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
134  instanceModel.HasOne(x => x.DreamDaemonSettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
135  instanceModel.HasOne(x => x.DreamMakerSettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
136  instanceModel.HasOne(x => x.RepositorySettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
137  instanceModel.HasMany(x => x.RevisionInformations).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
138  instanceModel.HasMany(x => x.InstanceUsers).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
139  instanceModel.HasMany(x => x.Jobs).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
140  instanceModel.HasOne(x => x.WatchdogReattachInformation).WithOne().OnDelete(DeleteBehavior.Cascade);
141  }
142 
144  public async Task Initialize(CancellationToken cancellationToken)
145  {
147  {
148  Logger.LogCritical("DropDatabase configuration option set! Dropping any existing database...");
149  await Database.EnsureDeletedAsync(cancellationToken).ConfigureAwait(false);
150  }
151 
152  var migrations = await Database.GetAppliedMigrationsAsync(cancellationToken).ConfigureAwait(false);
153  var wasEmpty = !migrations.Any();
154 
155  if (wasEmpty || (await Database.GetPendingMigrationsAsync(cancellationToken).ConfigureAwait(false)).Any())
156  {
157  Logger.LogInformation("Migrating database...");
158  await Database.MigrateAsync(cancellationToken).ConfigureAwait(false);
159  }
160  else
161  Logger.LogDebug("No migrations to apply.");
162 
163  wasEmpty |= (await Users.CountAsync(cancellationToken).ConfigureAwait(false)) == 0;
164 
165  if (wasEmpty)
166  {
167  Logger.LogInformation("Seeding database...");
168  await databaseSeeder.SeedDatabase(this, cancellationToken).ConfigureAwait(false);
169  }
171  {
172  Logger.LogWarning("Enabling and resetting admin password due to configuration!");
173  await databaseSeeder.ResetAdminPassword(this, cancellationToken).ConfigureAwait(false);
174  }
175  }
176 
178  public Task Save(CancellationToken cancellationToken) => SaveChangesAsync(cancellationToken);
179 
184  protected abstract bool UseMySQLMigrations();
185 
187  public async Task SchemaDowngradeForServerVersion(Version version, CancellationToken cancellationToken)
188  {
189  if (version == null)
190  throw new ArgumentNullException(nameof(version));
191  if (version < new Version(4, 0))
192  throw new ArgumentOutOfRangeException(nameof(version), version, "Not a valid V4 version!");
193 
194  string targetMigration = null;
195 
196  // Update this with new migrations as they are made
197  // Always use the MS class
198  if (version < new Version(4, 0, 2))
199  targetMigration = nameof(MSReattachCompileJobRequired);
200 
201  if (targetMigration == null)
202  return;
203 
204  if (UseMySQLMigrations())
205  targetMigration = String.Format(CultureInfo.InvariantCulture, "MY{0}", targetMigration.Substring(2));
206 
207  // even though it clearly implements it in the DatabaseFacade definition this won't work without casting (╯ಠ益ಠ)╯︵ ┻━┻
208  var dbServiceProvider = ((IInfrastructure<IServiceProvider>)Database).Instance;
209  var migrator = dbServiceProvider.GetRequiredService<IMigrator>();
210 
211  Logger.LogInformation("Migrating down to version {0}. Target: {1}", version, targetMigration);
212  try
213  {
214  await migrator.MigrateAsync(targetMigration, cancellationToken).ConfigureAwait(false);
215  }
216  catch (Exception e)
217  {
218  Logger.LogCritical("Failed to migrate! Exception: {0}", e);
219  }
220  }
221  }
222 }
Task Save(CancellationToken cancellationToken)
Saves changes made to the IDatabaseContext
+Go to the documentation of this file.
1 using Microsoft.EntityFrameworkCore;
2 using Microsoft.EntityFrameworkCore.Infrastructure;
3 using Microsoft.EntityFrameworkCore.Migrations;
4 using Microsoft.Extensions.DependencyInjection;
5 using Microsoft.Extensions.Logging;
6 using Microsoft.Extensions.Options;
7 using System;
8 using System.Globalization;
9 using System.Linq;
10 using System.Threading;
11 using System.Threading.Tasks;
15 
17 {
19  #pragma warning disable CA1506 // TODO: Decomplexify
20  abstract class DatabaseContext<TParentContext> : DbContext, IDatabaseContext where TParentContext : DbContext
21  {
23  public DbSet<User> Users { get; set; }
24 
26  public DbSet<Instance> Instances { get; set; }
27 
29  public DbSet<CompileJob> CompileJobs { get; set; }
30 
32  public DbSet<RevisionInformation> RevisionInformations { get; set; }
33 
35  public DbSet<DreamMakerSettings> DreamMakerSettings { get; set; }
36 
38  public DbSet<ChatBot> ChatBots { get; set; }
39 
41  public DbSet<DreamDaemonSettings> DreamDaemonSettings { get; set; }
42 
44  public DbSet<RepositorySettings> RepositorySettings { get; set; }
45 
47  public DbSet<InstanceUser> InstanceUsers { get; set; }
48 
50  public DbSet<ChatChannel> ChatChannels { get; set; }
51 
53  public DbSet<Job> Jobs { get; set; }
54 
56  public DbSet<ReattachInformation> ReattachInformations { get; set; }
57 
59  public DbSet<WatchdogReattachInformation> WatchdogReattachInformations { get; set; }
60 
64  public DbSet<TestMerge> TestMerges { get; set; }
65 
69  public DbSet<RevInfoTestMerge> RevInfoTestMerges { get; set; }
70 
74  protected ILogger Logger { get; }
75 
80 
84  protected abstract DatabaseType DatabaseType { get; }
85 
90 
98  public DatabaseContext(DbContextOptions<TParentContext> dbContextOptions, IOptions<DatabaseConfiguration> databaseConfigurationOptions, IDatabaseSeeder databaseSeeder, ILogger logger) : base(dbContextOptions)
99  {
100  DatabaseConfiguration = databaseConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(databaseConfigurationOptions));
101  this.databaseSeeder = databaseSeeder ?? throw new ArgumentNullException(nameof(databaseSeeder));
102  Logger = logger ?? throw new ArgumentNullException(nameof(logger));
103  }
104 
106  protected override void OnModelCreating(ModelBuilder modelBuilder)
107  {
108  Logger.LogTrace("Building entity framework context...");
109  base.OnModelCreating(modelBuilder);
110 
111  var userModel = modelBuilder.Entity<User>();
112  userModel.HasIndex(x => x.CanonicalName).IsUnique();
113  userModel.HasMany(x => x.TestMerges).WithOne(x => x.MergedBy).OnDelete(DeleteBehavior.Restrict);
114 
115  modelBuilder.Entity<InstanceUser>().HasIndex(x => new { x.UserId, x.InstanceId }).IsUnique();
116 
117  modelBuilder.Entity<TestMerge>().HasMany(x => x.RevisonInformations).WithOne(x => x.TestMerge).OnDelete(DeleteBehavior.Cascade);
118 
119  var revInfo = modelBuilder.Entity<RevisionInformation>();
120  revInfo.HasMany(x => x.CompileJobs).WithOne(x => x.RevisionInformation).OnDelete(DeleteBehavior.Cascade);
121  revInfo.HasMany(x => x.ActiveTestMerges).WithOne(x => x.RevisionInformation).OnDelete(DeleteBehavior.Cascade);
122  revInfo.HasOne(x => x.PrimaryTestMerge).WithOne(x => x.PrimaryRevisionInformation).OnDelete(DeleteBehavior.Restrict);
123  revInfo.HasIndex(x => new { x.InstanceId, x.CommitSha }).IsUnique();
124 
125  modelBuilder.Entity<CompileJob>().HasIndex(x => x.DirectoryName);
126 
127  modelBuilder.Entity<Job>().HasOne<CompileJob>().WithOne(x => x.Job).OnDelete(DeleteBehavior.Restrict);
128 
129  var chatChannel = modelBuilder.Entity<ChatChannel>();
130  chatChannel.HasIndex(x => new { x.ChatSettingsId, x.IrcChannel }).IsUnique();
131  chatChannel.HasIndex(x => new { x.ChatSettingsId, x.DiscordChannelId }).IsUnique();
132  chatChannel.HasOne(x => x.ChatSettings).WithMany(x => x.Channels).HasForeignKey(x => x.ChatSettingsId).OnDelete(DeleteBehavior.Cascade);
133 
134  modelBuilder.Entity<ChatBot>().HasIndex(x => x.Name).IsUnique();
135 
136  var instanceModel = modelBuilder.Entity<Instance>();
137  instanceModel.HasIndex(x => x.Path).IsUnique();
138  instanceModel.HasMany(x => x.ChatSettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
139  instanceModel.HasOne(x => x.DreamDaemonSettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
140  instanceModel.HasOne(x => x.DreamMakerSettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
141  instanceModel.HasOne(x => x.RepositorySettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
142  instanceModel.HasMany(x => x.RevisionInformations).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
143  instanceModel.HasMany(x => x.InstanceUsers).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
144  instanceModel.HasMany(x => x.Jobs).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
145  instanceModel.HasOne(x => x.WatchdogReattachInformation).WithOne().OnDelete(DeleteBehavior.Cascade);
146  }
147 
149  public virtual async Task Initialize(CancellationToken cancellationToken)
150  {
152  {
153  Logger.LogCritical("DropDatabase configuration option set! Dropping any existing database...");
154  await Database.EnsureDeletedAsync(cancellationToken).ConfigureAwait(false);
155  }
156 
157  var migrations = await Database.GetAppliedMigrationsAsync(cancellationToken).ConfigureAwait(false);
158  var wasEmpty = !migrations.Any();
159 
160  if (wasEmpty || (await Database.GetPendingMigrationsAsync(cancellationToken).ConfigureAwait(false)).Any())
161  {
162  Logger.LogInformation("Migrating database...");
163  await Database.MigrateAsync(cancellationToken).ConfigureAwait(false);
164  }
165  else
166  Logger.LogDebug("No migrations to apply.");
167 
168  wasEmpty |= (await Users.CountAsync(cancellationToken).ConfigureAwait(false)) == 0;
169 
170  if (wasEmpty)
171  {
172  Logger.LogInformation("Seeding database...");
173  await databaseSeeder.SeedDatabase(this, cancellationToken).ConfigureAwait(false);
174  }
176  {
177  Logger.LogWarning("Enabling and resetting admin password due to configuration!");
178  await databaseSeeder.ResetAdminPassword(this, cancellationToken).ConfigureAwait(false);
179  }
180  }
181 
183  public Task Save(CancellationToken cancellationToken) => SaveChangesAsync(cancellationToken);
184 
186  public async Task SchemaDowngradeForServerVersion(Version version, CancellationToken cancellationToken)
187  {
188  if (version == null)
189  throw new ArgumentNullException(nameof(version));
190  if (version < new Version(4, 0))
191  throw new ArgumentOutOfRangeException(nameof(version), version, "Not a valid V4 version!");
192 
193  string targetMigration = null;
194 
195  // Update this with new migrations as they are made
196  // Always use the MS class
197  if (version < new Version(4, 0, 2))
198  {
199  // Special handling because this is where SQLite was introduced
200  if (DatabaseType == DatabaseType.Sqlite)
201  throw new NotSupportedException("Cannot migrate below version 4.0.2.0 while using Sqlite!");
202 
203  targetMigration = nameof(MSReattachCompileJobRequired);
204  }
205 
206  // Uncomment once next migration/version step happens
207  /*
208  else if (version < new Version(V_NEXT_MIGRATION))
209  {
210  // Special handling because this is where SQLite was introduced
211  if (DatabaseType == DatabaseType.Sqlite)
212  targetMigration = nameof(SLAddSqlite);
213 
214  targetMigration = nameof(V_NEXT_LAST_MIGRATION);
215  }
216  */
217 
218  if (targetMigration == null)
219  {
220  Logger.LogDebug("No down migration required.");
221  return;
222  }
223 
224  string migrationSubstitution;
225  switch (DatabaseType)
226  {
227  case DatabaseType.SqlServer:
228  // already setup
229  migrationSubstitution = null;
230  break;
231  case DatabaseType.MySql:
232  case DatabaseType.MariaDB:
233  migrationSubstitution = "MY{0}";
234  break;
235  case DatabaseType.Sqlite:
236  migrationSubstitution = "SL{0}";
237  break;
238  default:
239  throw new InvalidOperationException($"Invalid DatabaseType: {DatabaseType}");
240  }
241 
242  if (migrationSubstitution != null)
243  targetMigration = String.Format(CultureInfo.InvariantCulture, migrationSubstitution, targetMigration.Substring(2));
244 
245  // even though it clearly implements it in the DatabaseFacade definition this won't work without casting (╯ಠ益ಠ)╯︵ ┻━┻
246  var dbServiceProvider = ((IInfrastructure<IServiceProvider>)Database).Instance;
247  var migrator = dbServiceProvider.GetRequiredService<IMigrator>();
248 
249  Logger.LogInformation("Migrating down to version {0}. Target: {1}", version, targetMigration);
250  try
251  {
252  await migrator.MigrateAsync(targetMigration, cancellationToken).ConfigureAwait(false);
253  }
254  catch (Exception e)
255  {
256  Logger.LogCritical("Failed to migrate! Exception: {0}", e);
257  }
258  }
259  }
260 }
Task Save(CancellationToken cancellationToken)
Saves changes made to the IDatabaseContext
ILogger Logger
The ILogger for the DatabaseContext<TParentContext>
-
For initially seeding a database
-
DatabaseContext(DbContextOptions< TParentContext > dbContextOptions, IOptions< DatabaseConfiguration > databaseConfigurationOptions, IDatabaseSeeder databaseSeeder, ILogger logger)
Construct a DatabaseContext<TParentContext>
+
DatabaseContext(DbContextOptions< TParentContext > dbContextOptions, IOptions< DatabaseConfiguration > databaseConfigurationOptions, IDatabaseSeeder databaseSeeder, ILogger logger)
Construct a DatabaseContext<TParentContext>
-
abstract bool UseMySQLMigrations()
If the MY_ class of migrations should be used instead of the MS_ class
DbSet< WatchdogReattachInformation > WatchdogReattachInformations
@@ -92,29 +90,31 @@ $(function() { -
async Task Initialize(CancellationToken cancellationToken)
Creates and migrates the IDatabaseContext
bool ResetAdminPassword
If the admin user should be enabled and have it's password reset
DbSet< RevInfoTestMerge > RevInfoTestMerges
The RevInfoTestMerges om the DatabaseContext<TParentContext>
Represents an Api.Models.Instance in the database
Definition: Instance.cs:8
-
async Task SchemaDowngradeForServerVersion(Version version, CancellationToken cancellationToken)
Attempt to downgrade the schema to the migration used for a given server version
+
async Task SchemaDowngradeForServerVersion(Version version, CancellationToken cancellationToken)
Attempt to downgrade the schema to the migration used for a given server version
+
virtual async Task Initialize(CancellationToken cancellationToken)
Creates and migrates the IDatabaseContext
Task ResetAdminPassword(IDatabaseContext databaseContext, CancellationToken cancellationToken)
Changes the admin password in IDatabaseContext back to it's default and enables the account
-
Marks the CompileJobs of ReattachInformations as non-nullable for MSSQL
Configuration options for the Database.DatabaseContext<TParentContext>
+
Marks the Models.CompileJobs of Models.ReattachInformations as non-nullable for MSSQL
+ +
DatabaseType
Type of database to user
Definition: DatabaseType.cs:6
bool DropDatabase
If the database should be deleted on application startup. Should not be used in production!
-
readonly IDatabaseSeeder databaseSeeder
The IDatabaseSeeder for the DatabaseContext<TParentContext>
+
readonly IDatabaseSeeder databaseSeeder
The IDatabaseSeeder for the DatabaseContext<TParentContext>
Task SeedDatabase(IDatabaseContext databaseContext, CancellationToken cancellationToken)
Initially seed a given databaseContext
-
override void OnModelCreating(ModelBuilder modelBuilder)
+
override void OnModelCreating(ModelBuilder modelBuilder)
- +
DbSet< TestMerge > TestMerges
The TestMerges in the DatabaseContext<TParentContext>
diff --git a/_database_context_factory_8cs_source.html b/_database_context_factory_8cs_source.html index 63b7adee19..6032e5862c 100644 --- a/_database_context_factory_8cs_source.html +++ b/_database_context_factory_8cs_source.html @@ -77,7 +77,7 @@ $(function() {
async Task UseContext(Func< IDatabaseContext, Task > operation)
Run an operation in the scope of an IDatabaseContext
readonly IServiceScopeFactory scopeFactory
The IServiceScopeFactory for the DatabaseContextFactory
DatabaseContextFactory(IServiceScopeFactory scopeFactory)
Construct a DatabaseContextFactory
- +
diff --git a/_database_type_8cs.html b/_database_type_8cs.html index 60de80e18b..1328a7522e 100644 --- a/_database_type_8cs.html +++ b/_database_type_8cs.html @@ -92,7 +92,8 @@ Namespaces Enumerations enum  Tgstation.Server.Host.Configuration.DatabaseType { Tgstation.Server.Host.Configuration.DatabaseType.SqlServer, Tgstation.Server.Host.Configuration.DatabaseType.MySql, -Tgstation.Server.Host.Configuration.DatabaseType.MariaDB +Tgstation.Server.Host.Configuration.DatabaseType.MariaDB, +Tgstation.Server.Host.Configuration.DatabaseType.Sqlite }  Type of database to user More...
  diff --git a/_database_type_8cs_source.html b/_database_type_8cs_source.html index 6ecc38f08f..b451f12e05 100644 --- a/_database_type_8cs_source.html +++ b/_database_type_8cs_source.html @@ -71,10 +71,11 @@ $(function() {
DatabaseType.cs
-Go to the documentation of this file. diff --git a/_dmb_factory_8cs_source.html b/_dmb_factory_8cs_source.html index 6877a58645..5d7484238f 100644 --- a/_dmb_factory_8cs_source.html +++ b/_dmb_factory_8cs_source.html @@ -109,7 +109,7 @@ $(function() {
readonly ILogger< DmbFactory > logger
The ILogger for the DmbFactory
Definition: DmbFactory.cs:45
string ConcatPath(params string[] paths)
Combines an array of strings into a path
- +
readonly Api.Models.Instance instance
The Api.Models.Instance for the DmbFactory
Definition: DmbFactory.cs:50
diff --git a/_dream_daemon_controller_8cs_source.html b/_dream_daemon_controller_8cs_source.html index f45284410b..8408373766 100644 --- a/_dream_daemon_controller_8cs_source.html +++ b/_dream_daemon_controller_8cs_source.html @@ -123,7 +123,7 @@ $(function() {
Task< IActionResult > Read(CancellationToken cancellationToken)
Get the watchdog status.
RebootState
Represents the action to take when /world/Reboot() is called
Definition: RebootState.cs:6
- +
DreamDaemonSecurity? SecurityLevel
The DreamDaemonSecurity level of DreamDaemon
Models.Instance Instance
The Instance for the operation
diff --git a/_dream_maker_controller_8cs_source.html b/_dream_maker_controller_8cs_source.html index 8d47af811f..57b0894c14 100644 --- a/_dream_maker_controller_8cs_source.html +++ b/_dream_maker_controller_8cs_source.html @@ -119,7 +119,7 @@ $(function() {
Represents an error message returned by the server
Definition: ErrorMessage.cs:8
- +
diff --git a/_experimental_watchdog_8cs_source.html b/_experimental_watchdog_8cs_source.html index b64882ab7f..75750c5817 100644 --- a/_experimental_watchdog_8cs_source.html +++ b/_experimental_watchdog_8cs_source.html @@ -163,7 +163,7 @@ $(function() {
static async Task< SemaphoreSlimContext > Lock(SemaphoreSlim semaphore, CancellationToken cancellationToken)
Asyncronously locks a semaphore
void ResetRebootState()
Changes RebootState to Watchdog.RebootState.Normal without telling the DMAPI
RebootState
Represents the action to take when /world/Reboot() is called
Definition: RebootState.cs:6
- + diff --git a/_home_controller_8cs_source.html b/_home_controller_8cs_source.html index d127ff7b58..e9050afd4a 100644 --- a/_home_controller_8cs_source.html +++ b/_home_controller_8cs_source.html @@ -121,7 +121,7 @@ $(function() {
readonly ITokenFactory tokenFactory
The ITokenFactory for the HomeController
string Uid
A unique identifier for the user
- + diff --git a/_i_database_connection_factory_8cs_source.html b/_i_database_connection_factory_8cs_source.html index 97827d6354..f295321042 100644 --- a/_i_database_connection_factory_8cs_source.html +++ b/_i_database_connection_factory_8cs_source.html @@ -77,7 +77,7 @@ $(function() {
DatabaseType
Type of database to user
Definition: DatabaseType.cs:6
- + diff --git a/_i_database_context_8cs_source.html b/_i_database_context_8cs_source.html index d9f026f74d..115d02848c 100644 --- a/_i_database_context_8cs_source.html +++ b/_i_database_context_8cs_source.html @@ -91,7 +91,7 @@ $(function() {
Task Save(CancellationToken cancellationToken)
Saves changes made to the IDatabaseContext
DbSet< InstanceUser > InstanceUsers
The InstanceUsers in the IDatabaseContext
- + diff --git a/_i_database_context_factory_8cs_source.html b/_i_database_context_factory_8cs_source.html index b577ad6bf0..a3f984279d 100644 --- a/_i_database_context_factory_8cs_source.html +++ b/_i_database_context_factory_8cs_source.html @@ -73,7 +73,7 @@ $(function() {
Go to the documentation of this file.
1 using System;
2 using System.Threading.Tasks;
3 
5 {
10  {
16  Task UseContext(Func<IDatabaseContext, Task> operation);
17  }
18 }
Factory for scoping usage of IDatabaseContexts. Meant for use by Components
Task UseContext(Func< IDatabaseContext, Task > operation)
Run an operation in the scope of an IDatabaseContext
- +