-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathpatch.php
More file actions
35 lines (30 loc) · 739 Bytes
/
patch.php
File metadata and controls
35 lines (30 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace w8io;
if( file_exists( 'config.php' ) )
require_once 'config.php';
else
require_once 'config.sample.php';
if( 0 )
{
$db = new \deemru\Triples( W8DB, 'data' );
$patches = $db->query( 'SELECT r0 FROM data WHERE r6 = 0' );
foreach( $patches as $patch )
{
$db->query( 'UPDATE data SET r2 = 0 WHERE r0 = ' . $patch[0] );
}
}
if( 10 )
{
$cmds =
[
'ALTER TABLE data DROP COLUMN r7',
];
foreach( $cmds as $cmd )
{
$tt = microtime( true );
$cmd = 'sqlite3 ' . W8IO_DB_PATH . ' "' . $cmd . '"';
wk()->log( 'exec( ' . $cmd . ' )' );
exec( $cmd );
wk()->log( sprintf( '%.00f seconds', ( microtime( true ) - $tt ) ) );
}
}