modifs.mineures sans commentaires
This commit is contained in:
parent
cae38dae95
commit
299b90c85e
@ -175,24 +175,24 @@ EOT;
|
||||
];
|
||||
|
||||
protected function _prepareMetadata(): void {
|
||||
if (!$this->tableExists(self::METADATA_TABLE)) {
|
||||
if (!$this->tableExists(static::METADATA_TABLE)) {
|
||||
$db = $this->db();
|
||||
$db->exec([
|
||||
"drop table",
|
||||
"drop table if exists",
|
||||
"table" => self::CHANNELS_TABLE,
|
||||
]);
|
||||
$db->exec([
|
||||
"drop table",
|
||||
"drop table if exists",
|
||||
"table" => _migration::MIGRATION_TABLE
|
||||
]);
|
||||
$db->exec([
|
||||
"create table",
|
||||
"table" => self::METADATA_TABLE,
|
||||
"cols" => self::METADATA_COLS,
|
||||
"table" => static::METADATA_TABLE,
|
||||
"cols" => static::METADATA_COLS,
|
||||
]);
|
||||
$db->exec([
|
||||
"insert",
|
||||
"into" => self::METADATA_TABLE,
|
||||
"into" => static::METADATA_TABLE,
|
||||
"values" => [
|
||||
"name" => "version",
|
||||
"value" => "1",
|
||||
@ -205,7 +205,7 @@ EOT;
|
||||
|
||||
const CHANNELS_TABLE = "_channels";
|
||||
const CHANNELS_COLS = [
|
||||
"name" => "varchar primary key",
|
||||
"name" => "varchar not null primary key",
|
||||
"table_name" => "varchar",
|
||||
"class_name" => "varchar",
|
||||
];
|
||||
|
@ -83,7 +83,7 @@ class _select extends _common {
|
||||
|
||||
## from
|
||||
$from = $query["from"] ?? null;
|
||||
if (self::consume('from\s+([a-z_][a-z0-9_]*)\s*(?=;?\s*$|\bwhere\b)', $tmpsql, $ms)) {
|
||||
if (self::consume('from\s+([a-z_][a-z0-9_.]*)\s*(?=;?\s*$|\bwhere\b)', $tmpsql, $ms)) {
|
||||
if ($from === null) $from = $ms[1];
|
||||
$sql[] = "from";
|
||||
$sql[] = $from;
|
||||
|
@ -35,6 +35,11 @@ class MysqlStorage extends CapacitorStorage {
|
||||
return $found !== null;
|
||||
}
|
||||
|
||||
const METADATA_COLS = [
|
||||
"name" => "varchar(64) not null primary key",
|
||||
"value" => "varchar(255)",
|
||||
];
|
||||
|
||||
function _getMigration(CapacitorChannel $channel): _mysqlMigration {
|
||||
return new _mysqlMigration(cl::merge([
|
||||
$this->_createSql($channel),
|
||||
@ -47,7 +52,7 @@ class MysqlStorage extends CapacitorStorage {
|
||||
}
|
||||
|
||||
const CHANNELS_COLS = [
|
||||
"name" => "varchar(255) primary key",
|
||||
"name" => "varchar(255) not null primary key",
|
||||
"table_name" => "varchar(64)",
|
||||
"class_name" => "varchar(255)",
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user