File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,15 +10,15 @@ class Database {
1010 }
1111
1212 read ( sid , cb ) {
13- this [ kConnection ] . table ( this [ kTable ] ) . where ( { sid } ) . value ( 'data ' ) . then ( res => {
13+ this [ kConnection ] . table ( this [ kTable ] ) . where ( { sid } ) . value ( 'payload ' ) . then ( res => {
1414 cb ( null , ( res ? JSON . parse ( res ) : { } ) )
1515 } ) . catch ( err => {
1616 cb ( err , null )
1717 } )
1818 }
1919
2020 write ( sid , data , cb ) {
21- this [ kConnection ] . table ( this [ kTable ] ) . updateOrInsert ( { sid } , { data : JSON . stringify ( data ) } ) . then ( res => {
21+ this [ kConnection ] . table ( this [ kTable ] ) . updateOrInsert ( { sid } , { payload : JSON . stringify ( data ) } ) . then ( res => {
2222 cb ( null , res )
2323 } ) . catch ( function ( err ) {
2424 cb ( err , null )
@@ -34,4 +34,4 @@ class Database {
3434 }
3535
3636}
37- module . exports = Database
37+ module . exports = Database
Original file line number Diff line number Diff line change 1- const Schema = require(' @ostro/database/ schema')
1+ const Schema = require(" @ostro/support/facades/ schema");
22const Migration = require('@ostro/database/migration')
33
44class CreateSessionsTable extends Migration {
55
66 async up() {
77 await Schema.create('sessions', function ($table) {
8- $table.string('id').primary();
9- $table.foreignId('user_id').nullable().index();
8+ $table.string('sid').primary();
109 $table.string('ip_address', 45).nullable();
1110 $table.text('user_agent').nullable();
12- $table.text('payload');
11+ $table.text('payload').nullable() ;
1312 $table.integer('last_activity').index();
1413 });
1514 }
@@ -19,4 +18,4 @@ class CreateSessionsTable extends Migration {
1918 }
2019}
2120
22- module.exports = CreateSessionsTable
21+ module.exports = CreateSessionsTable
You can’t perform that action at this time.
0 commit comments