Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Adding methods for reverse migrations #52

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.DS_Store
.*.sw?
.idea
/nbproject/private/
nbproject/
14 changes: 14 additions & 0 deletions src/Firebird/Query/Processors/FirebirdProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,18 @@

class FirebirdProcessor extends Processor {

/**
* Process the results of a column listing query.
*
* @param array $results
* @return array
*/
public function processColumnListing($results) {
array_walk($results, function(&$object) {
$array = (array) $object;
$object = trim($array['RDB$FIELD_NAME']);
});
return $results;
}

}
11 changes: 10 additions & 1 deletion src/Firebird/Schema/Grammars/FirebirdGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ public function compileTableExists()
return "SELECT RDB\$RELATION_NAME FROM RDB\$RELATIONS WHERE RDB\$RELATION_NAME = ?";
}

/**
/**
* Compile the query to determine the list of columns.
*
* @return string
*/
public function compileColumnListing($table) {
return "SELECT RDB\$FIELD_NAME FROM RDB\$RELATION_FIELDS WHERE RDB\$RELATION_NAME = '$table'";
}

/**
* Compile a create table command.
*
* @param \Illuminate\Database\Schema\Blueprint $blueprint
Expand Down