File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 11<?php
22
3+
34namespace orm \DataBase ;
45
56
@@ -45,10 +46,10 @@ public function migrate()
4546 {
4647 try {
4748 (new QueryExecutor (PdoAdapter::getInstance ()
48- ->getPdoObject ()->prepare (
49- (new Migration ($ this ->table_fields , $ this ->table_name ))
50- ->buildMigrationSqlCode ()), []))
51- -> execute ();
49+ ->getPdoObject ()->prepare (
50+ (new Migration ($ this ->table_fields , $ this ->table_name ))
51+ ->buildMigrationSqlCode ()), []))
52+ -> executeSql ();
5253 } catch (\PDOException $ e ) {
5354 throw new MigrationException ($ e ->getMessage ());
5455 }
Original file line number Diff line number Diff line change @@ -96,10 +96,19 @@ public function select()
9696 * select|insertOrUpdate|delete). Substitute data to prepared query
9797 * and execute it.
9898 */
99- public function execute ()
99+ private function execute ()
100100 {
101101 $ this ->pdo ->beginTransaction ();
102102 $ this ->query ->execute ($ this ->data );
103103 }
104104
105+ /**
106+ * Execute pure sql query. Use this only for migrations.
107+ */
108+ public function executeSql ()
109+ {
110+ $ this ->execute ();
111+ $ this ->pdo ->commit ();
112+ }
113+
105114}
You can’t perform that action at this time.
0 commit comments