forked from mirzaev/deeproots_bot
Fix ID integer length error & change those pesky tabulations
This commit is contained in:
parent
ced4e3241c
commit
49f7601376
|
@ -60,7 +60,7 @@ final class account extends core
|
|||
$this->database = new database()
|
||||
->encoding(encoding::utf8)
|
||||
->columns(
|
||||
new column('identifier', type::integer_unsigned),
|
||||
new column('identifier', type::long_long_unsigned),
|
||||
new column('name', type::string, ['length' => 64]),
|
||||
new column('language', type::string, ['length' => 2]),
|
||||
new column('authorized_system', type::char),
|
||||
|
|
|
@ -61,7 +61,7 @@ final class answer extends core
|
|||
$this->database = new database()
|
||||
->encoding(encoding::ascii)
|
||||
->columns(
|
||||
new column('identifier', type::integer_unsigned),
|
||||
new column('identifier', type::long_long_unsigned),
|
||||
new column('A', type::char),
|
||||
new column('B', type::char),
|
||||
new column('C', type::char),
|
||||
|
|
|
@ -67,7 +67,7 @@ final class connection extends core
|
|||
->columns(
|
||||
new column('identifier', type::integer_unsigned),
|
||||
new column('account', type::integer_unsigned),
|
||||
new column('telegram', type::integer_unsigned),
|
||||
new column('telegram', type::long_long_unsigned),
|
||||
new column('active', type::char),
|
||||
new column('updated', type::integer_unsigned),
|
||||
new column('created', type::integer_unsigned)
|
||||
|
|
|
@ -59,7 +59,7 @@ final class question extends core
|
|||
$this->database = new database()
|
||||
->encoding(encoding::ascii)
|
||||
->columns(
|
||||
new column('identifier', type::integer_unsigned),
|
||||
new column('identifier', type::long_long_unsigned),
|
||||
new column('active', type::char),
|
||||
new column('updated', type::integer_unsigned),
|
||||
new column('created', type::integer_unsigned)
|
||||
|
|
|
@ -61,7 +61,7 @@ final class localization extends core
|
|||
$this->database = new database()
|
||||
->encoding(encoding::ascii)
|
||||
->columns(
|
||||
new column('identifier', type::integer_unsigned),
|
||||
new column('identifier', type::long_long_unsigned),
|
||||
new column('text', type::string, ['length' => 256]),
|
||||
new column('A', type::string, ['length' => 128]),
|
||||
new column('B', type::string, ['length' => 128]),
|
||||
|
|
|
@ -60,7 +60,7 @@ final class telegram extends core
|
|||
$this->database = new database()
|
||||
->encoding(encoding::utf8)
|
||||
->columns(
|
||||
new column('identifier', type::integer_unsigned),
|
||||
new column('identifier', type::long_long_unsigned),
|
||||
new column('domain', type::string, ['length' => 32]),
|
||||
new column('name_first', type::string, ['length' => 64]),
|
||||
new column('name_second', type::string, ['length' => 64]),
|
||||
|
@ -106,7 +106,7 @@ final class telegram extends core
|
|||
update: function (record &$record) use ($telegram){
|
||||
// Writing new values into the record
|
||||
$record->name_first = $telegram->getFirstName();
|
||||
$record->name_second = $telegram->getLastName();
|
||||
$record->name_second = (string) $telegram->getLastName();
|
||||
$record->domain = $telegram->getUsername();
|
||||
$record->updated = svoboda::timestamp();
|
||||
},
|
||||
|
@ -171,12 +171,14 @@ final class telegram extends core
|
|||
// Initializing the identifier
|
||||
$identifier = (int) $telegram->getId();
|
||||
|
||||
echo(svoboda::timestamp());
|
||||
|
||||
// Initializing the record
|
||||
$record = $this->database->record(
|
||||
$identifier,
|
||||
$telegram->getUsername(),
|
||||
$telegram->getFirstName(),
|
||||
$telegram->getLastName(),
|
||||
(string) $telegram->getLastName(),
|
||||
$telegram->getLanguageCode(),
|
||||
(int) $telegram->isBot(),
|
||||
svoboda::timestamp(),
|
||||
|
|
|
@ -19,9 +19,9 @@ use Zanzara\Zanzara as zanzara,
|
|||
Zanzara\Config as config;
|
||||
|
||||
// Enabling debugging
|
||||
/* ini_set('error_reporting', E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1); */
|
||||
// ini_set('error_reporting', E_ALL);
|
||||
// ini_set('display_errors', 1);
|
||||
// ini_set('display_startup_errors', 1);
|
||||
|
||||
// Initializing path to the public directory
|
||||
define('INDEX', __DIR__);
|
||||
|
|
|
@ -23,14 +23,14 @@ $file = DATABASES . DIRECTORY_SEPARATOR . 'telegram.baza';
|
|||
$database = new database()
|
||||
->encoding(encoding::utf8)
|
||||
->columns(
|
||||
new column('identifier', type::integer_unsigned),
|
||||
new column('identifier', type::long_long_unsigned),
|
||||
new column('domain', type::string, ['length' => 32]),
|
||||
new column('name_first', type::string, ['length' => 64]),
|
||||
new column('name_second', type::string, ['length' => 64]),
|
||||
new column('language', type::string, ['length' => 2]),
|
||||
new column('robot', type::char),
|
||||
new column('updated', type::integer_unsigned),
|
||||
new column('created', type::integer_unsigned)
|
||||
new column('updated', type::integer),
|
||||
new column('created', type::integer)
|
||||
)
|
||||
->connect($file);
|
||||
|
||||
|
|
Loading…
Reference in New Issue