From f24039593009515ca5ee41d1b038f4f5309744f6 Mon Sep 17 00:00:00 2001 From: Tim Schwartz Date: Thu, 3 Jun 2021 06:05:26 -0500 Subject: [PATCH] Migration and model for UnifiSite --- ..._unifi_devices_add_authkey_site_fields.php | 34 +++++++++++++++++++ ..._05_13_230810_create_unifi_sites_table.php | 34 +++++++++++++++++++ src/Models/UnifiSite.php | 15 ++++++++ 3 files changed, 83 insertions(+) create mode 100644 src/Migrations/2021_05_13_043430_unifi_devices_add_authkey_site_fields.php create mode 100644 src/Migrations/2021_05_13_230810_create_unifi_sites_table.php create mode 100644 src/Models/UnifiSite.php diff --git a/src/Migrations/2021_05_13_043430_unifi_devices_add_authkey_site_fields.php b/src/Migrations/2021_05_13_043430_unifi_devices_add_authkey_site_fields.php new file mode 100644 index 0000000..80bfc1c --- /dev/null +++ b/src/Migrations/2021_05_13_043430_unifi_devices_add_authkey_site_fields.php @@ -0,0 +1,34 @@ +string('auth_key')->default('ba86f2bbe107c7c57eb5f2690775c712'); + $table->string('site_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('unifi_devices', function (Blueprint $table) { + $table->dropColumn('auth_key'); + $table->dropColumn('site_id'); + }); + } +} diff --git a/src/Migrations/2021_05_13_230810_create_unifi_sites_table.php b/src/Migrations/2021_05_13_230810_create_unifi_sites_table.php new file mode 100644 index 0000000..7b9e006 --- /dev/null +++ b/src/Migrations/2021_05_13_230810_create_unifi_sites_table.php @@ -0,0 +1,34 @@ +timestamps(); + $table->softDeletes(); + $table->string('id'); + $table->primary('id'); + $table->string('name'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('unifi_sites'); + } +} diff --git a/src/Models/UnifiSite.php b/src/Models/UnifiSite.php new file mode 100644 index 0000000..1a13032 --- /dev/null +++ b/src/Models/UnifiSite.php @@ -0,0 +1,15 @@ +