From fb36f0bc60a68ea6d13aad6c9ecb6218ed4fdad4 Mon Sep 17 00:00:00 2001 From: djamp42 <25335691+djamp42@users.noreply.github.com> Date: Sat, 19 Jun 2021 00:37:50 -0400 Subject: [PATCH] Create Laravel Sessions Table (#12962) * create laravel sessions table * fixing last commit --- ...021_06_07_123600_create_sessions_table.php | 34 ++++++++ misc/db_schema.yaml | 84 +++++++++++-------- 2 files changed, 82 insertions(+), 36 deletions(-) create mode 100644 database/migrations/2021_06_07_123600_create_sessions_table.php diff --git a/database/migrations/2021_06_07_123600_create_sessions_table.php b/database/migrations/2021_06_07_123600_create_sessions_table.php new file mode 100644 index 0000000000..94e9835be0 --- /dev/null +++ b/database/migrations/2021_06_07_123600_create_sessions_table.php @@ -0,0 +1,34 @@ +string('id')->primary(); + $table->foreignId('user_id')->nullable()->index(); + $table->string('ip_address', 45)->nullable(); + $table->text('user_agent')->nullable(); + $table->text('payload'); + $table->integer('last_activity')->index(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('sessions'); + } +} diff --git a/misc/db_schema.yaml b/misc/db_schema.yaml index 2d5d9ad197..5d7b545b32 100644 --- a/misc/db_schema.yaml +++ b/misc/db_schema.yaml @@ -792,7 +792,7 @@ ipv6_networks: PRIMARY: { Name: PRIMARY, Columns: [ipv6_network_id], Unique: true, Type: BTREE } isis_adjacencies: Columns: - - { Field: id, Type: int unsigned, 'Null': false, Extra: 'auto_increment' } + - { Field: id, Type: 'int unsigned', 'Null': false, Extra: auto_increment } - { Field: device_id, Type: int, 'Null': false, Extra: '' } - { Field: port_id, Type: int, 'Null': false, Extra: '' } - { Field: ifIndex, Type: int, 'Null': false, Extra: '' } @@ -800,15 +800,15 @@ isis_adjacencies: - { Field: isisISAdjNeighSysType, Type: varchar(128), 'Null': false, Extra: '' } - { Field: isisISAdjNeighSysID, Type: varchar(128), 'Null': false, Extra: '' } - { Field: isisISAdjNeighPriority, Type: varchar(128), 'Null': false, Extra: '' } - - { Field: isisISAdjLastUpTime, Type: bigint unsigned, 'Null': false, Extra: '' } + - { Field: isisISAdjLastUpTime, Type: 'bigint unsigned', 'Null': false, Extra: '' } - { Field: isisISAdjAreaAddress, Type: varchar(128), 'Null': false, Extra: '' } - { Field: isisISAdjIPAddrType, Type: varchar(128), 'Null': false, Extra: '' } - { Field: isisISAdjIPAddrAddress, Type: varchar(128), 'Null': false, Extra: '' } Indexes: PRIMARY: { Name: PRIMARY, Columns: [id], Unique: true, Type: BTREE } isis_adjacencies_device_id_index: { Name: isis_adjacencies_device_id_index, Columns: [device_id], Unique: false, Type: BTREE } - isis_adjacencies_port_id_index: { Name: isis_adjacencies_port_id_index, Columns: [port_id], Unique: false, Type: BTREE } isis_adjacencies_ifindex_index: { Name: isis_adjacencies_ifindex_index, Columns: [ifIndex], Unique: false, Type: BTREE } + isis_adjacencies_port_id_index: { Name: isis_adjacencies_port_id_index, Columns: [port_id], Unique: false, Type: BTREE } juniAtmVp: Columns: - { Field: id, Type: 'bigint unsigned', 'Null': false, Extra: auto_increment } @@ -1480,25 +1480,6 @@ ports: PRIMARY: { Name: PRIMARY, Columns: [port_id], Unique: true, Type: BTREE } ports_device_id_ifindex_unique: { Name: ports_device_id_ifindex_unique, Columns: [device_id, ifIndex], Unique: true, Type: BTREE } ports_ifdescr_index: { Name: ports_ifdescr_index, Columns: [ifDescr], Unique: false, Type: BTREE } -port_groups: - Columns: - - { Field: id, Type: 'int unsigned', 'Null': false, Extra: auto_increment } - - { Field: name, Type: varchar(255), 'Null': false, Extra: ''} - - { Field: desc, Type: varchar(255), 'Null': true, Extra: ''} - Indexes: - PRIMARY: { Name: PRIMARY, Columns: [id], Unique: true, Type: BTREE } - port_groups_name_unique: { Name: port_groups_name_unique, Columns: [name], Unique: true, Type: BTREE } -port_group_port: - Columns: - - { Field: port_group_id, Type: 'int unsigned', 'Null': false, Extra: '' } - - { Field: port_id, Type: 'int unsigned', 'Null': false, Extra: '' } - Indexes: - PRIMARY: { Name: PRIMARY, Columns: [port_group_id, port_id], Unique: true, Type: BTREE } - port_group_port_port_group_id_index: { Name: port_group_port_port_group_id_index, Columns: [port_group_id], Unique: false, Type: BTREE } - port_group_port_port_id_index: { Name: port_group_port_port_id_index, Columns: [port_id], Unique: false, Type: BTREE } - Constraints: - port_group_port_port_group_id_foreign: { name: port_group_port_port_group_id_foreign, foreign_key: port_group_id, table: port_groups, key: id, extra: 'ON DELETE CASCADE' } - port_group_port_port_id_foreign: { name: port_group_port_port_id_foreign, foreign_key: port_id, table: ports, key: port_id, extra: 'ON DELETE CASCADE' } ports_adsl: Columns: - { Field: port_id, Type: 'int unsigned', 'Null': false, Extra: '' } @@ -1647,6 +1628,39 @@ ports_vlans: Indexes: PRIMARY: { Name: PRIMARY, Columns: [port_vlan_id], Unique: true, Type: BTREE } ports_vlans_device_id_port_id_vlan_unique: { Name: ports_vlans_device_id_port_id_vlan_unique, Columns: [device_id, port_id, vlan], Unique: true, Type: BTREE } +port_groups: + Columns: + - { Field: id, Type: 'int unsigned', 'Null': false, Extra: auto_increment } + - { Field: name, Type: varchar(255), 'Null': false, Extra: '' } + - { Field: desc, Type: varchar(255), 'Null': true, Extra: '' } + Indexes: + PRIMARY: { Name: PRIMARY, Columns: [id], Unique: true, Type: BTREE } + port_groups_name_unique: { Name: port_groups_name_unique, Columns: [name], Unique: true, Type: BTREE } +port_group_port: + Columns: + - { Field: port_group_id, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: port_id, Type: 'int unsigned', 'Null': false, Extra: '' } + Indexes: + PRIMARY: { Name: PRIMARY, Columns: [port_group_id, port_id], Unique: true, Type: BTREE } + port_group_port_port_group_id_index: { Name: port_group_port_port_group_id_index, Columns: [port_group_id], Unique: false, Type: BTREE } + port_group_port_port_id_index: { Name: port_group_port_port_id_index, Columns: [port_id], Unique: false, Type: BTREE } + Constraints: + port_group_port_port_group_id_foreign: { name: port_group_port_port_group_id_foreign, foreign_key: port_group_id, table: port_groups, key: id, extra: 'ON DELETE CASCADE' } + port_group_port_port_id_foreign: { name: port_group_port_port_id_foreign, foreign_key: port_id, table: ports, key: port_id, extra: 'ON DELETE CASCADE' } +printer_supplies: + Columns: + - { Field: supply_id, Type: 'int unsigned', 'Null': false, Extra: auto_increment } + - { Field: device_id, Type: 'int unsigned', 'Null': false, Extra: '', Default: '0' } + - { Field: supply_index, Type: int, 'Null': false, Extra: '' } + - { Field: supply_type, Type: varchar(64), 'Null': false, Extra: '' } + - { Field: supply_oid, Type: varchar(64), 'Null': false, Extra: '' } + - { Field: supply_descr, Type: varchar(255), 'Null': false, Extra: '', Default: '' } + - { Field: supply_capacity, Type: int, 'Null': false, Extra: '', Default: '0' } + - { Field: supply_current, Type: int, 'Null': false, Extra: '', Default: '0' } + - { Field: supply_capacity_oid, Type: varchar(64), 'Null': true, Extra: '' } + Indexes: + PRIMARY: { Name: PRIMARY, Columns: [supply_id], Unique: true, Type: BTREE } + toner_device_id_index: { Name: toner_device_id_index, Columns: [device_id], Unique: false, Type: BTREE } processes: Columns: - { Field: id, Type: 'bigint unsigned', 'Null': false, Extra: auto_increment } @@ -1845,6 +1859,18 @@ session: Indexes: PRIMARY: { Name: PRIMARY, Columns: [session_id], Unique: true, Type: BTREE } session_session_value_unique: { Name: session_session_value_unique, Columns: [session_value], Unique: true, Type: BTREE } +sessions: + Columns: + - { Field: id, Type: varchar(255), 'Null': false, Extra: '' } + - { Field: user_id, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ip_address, Type: varchar(45), 'Null': true, Extra: '' } + - { Field: user_agent, Type: text, 'Null': true, Extra: '' } + - { Field: payload, Type: text, 'Null': false, Extra: '' } + - { Field: last_activity, Type: int, 'Null': false, Extra: '' } + Indexes: + PRIMARY: { Name: PRIMARY, Columns: [id], Unique: true, Type: BTREE } + sessions_last_activity_index: { Name: sessions_last_activity_index, Columns: [last_activity], Unique: false, Type: BTREE } + sessions_user_id_index: { Name: sessions_user_id_index, Columns: [user_id], Unique: false, Type: BTREE } slas: Columns: - { Field: sla_id, Type: 'int unsigned', 'Null': false, Extra: auto_increment } @@ -2106,17 +2132,3 @@ wireless_sensors: wireless_sensors_sensor_type_index: { Name: wireless_sensors_sensor_type_index, Columns: [sensor_type], Unique: false, Type: BTREE } Constraints: wireless_sensors_device_id_foreign: { name: wireless_sensors_device_id_foreign, foreign_key: device_id, table: devices, key: device_id, extra: 'ON DELETE CASCADE' } -printer_supplies: - Columns: - - { Field: supply_id, Type: 'int unsigned', 'Null': false, Extra: auto_increment } - - { Field: device_id, Type: 'int unsigned', 'Null': false, Extra: '', Default: '0' } - - { Field: supply_index, Type: int, 'Null': false, Extra: '' } - - { Field: supply_type, Type: varchar(64), 'Null': false, Extra: '' } - - { Field: supply_oid, Type: varchar(64), 'Null': false, Extra: '' } - - { Field: supply_descr, Type: varchar(255), 'Null': false, Extra: '', Default: '' } - - { Field: supply_capacity, Type: int, 'Null': false, Extra: '', Default: '0' } - - { Field: supply_current, Type: int, 'Null': false, Extra: '', Default: '0' } - - { Field: supply_capacity_oid, Type: varchar(64), 'Null': true, Extra: '' } - Indexes: - PRIMARY: { Name: PRIMARY, Columns: [supply_id], Unique: true, Type: BTREE } - toner_device_id_index: { Name: toner_device_id_index, Columns: [device_id], Unique: false, Type: BTREE }