exec(); } public function migrate(ORMMigrate $orm) { $sql = []; $sql[] = "CREATE TABLE IF NOT EXISTS "; $sql[] = $orm->table; $sql[] = " ( "; $columns = []; foreach ($orm->columns as $name => $value) { $type = $value[0]; $propety = $value[1] ?? ""; $columns[] = "$name $type $propety"; } $sql[] = implode(", ",$columns); $sql[] = ") charset=" . $orm->charset; } } ORM::$defaultConnection = new MySQLEngine("mysql","root",""); ORM::migrate(function($table){ $table->id("int","auto_increment primary key"); $table->name("text"); $table->value("text"); });