Adopt postgres stuff
This commit is contained in:
parent
40c9923053
commit
418cc03a27
|
@ -44,7 +44,7 @@ MongooseAdapter.prototype.define = function (descr) {
|
|||
var props = {};
|
||||
Object.keys(descr.properties).forEach(function (key) {
|
||||
props[key] = descr.properties[key].type;
|
||||
if (props[key].name === 'Text') props[key] = String;
|
||||
if (props[key].name === 'Text' || props[key].name === 'JSON') props[key] = String;
|
||||
});
|
||||
var schema = new mongoose.Schema(props);
|
||||
this._models[descr.model.modelName] = mongoose.model(descr.model.modelName, schema);
|
||||
|
|
|
@ -411,6 +411,7 @@ function datatype(p) {
|
|||
var dt = '';
|
||||
switch (p.type.name) {
|
||||
case 'String':
|
||||
case 'JSON':
|
||||
dt = 'VARCHAR(' + (p.limit || 255) + ')';
|
||||
break;
|
||||
case 'Text':
|
||||
|
|
|
@ -516,6 +516,7 @@ function escape(val) {
|
|||
function datatype(p) {
|
||||
switch (p.type.name) {
|
||||
case 'String':
|
||||
case 'JSON':
|
||||
return 'varchar';
|
||||
case 'Text':
|
||||
return 'text';
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
{
|
||||
"name": "jugglingdb",
|
||||
"description": "ORM for every database: redis, mysql, neo4j, mongodb, postgres, sqlite",
|
||||
"version": "0.1.10",
|
||||
"version": "0.1.11",
|
||||
"author": "Anatoliy Chakkaev <rpm1602@gmail.com>",
|
||||
"contributors": [
|
||||
{ "name": "Anatoliy Chakkaev", "email": "rpm1602@gmail.com" },
|
||||
{ "name": "Julien Guimont", "email": "julien.guimont@gmail.com" },
|
||||
{ "name": "Joseph Junker", "email": "joseph.jnk@gmail.com" },
|
||||
{ "name": "Henri Bergius", "email": "henri.bergius@iki.fi" },
|
||||
{ "name": "redvulps", "email": "fabopereira@gmail.com" },
|
||||
{ "name": "Felipe Sateler", "email": "fsateler@gmail.com" },
|
||||
|
|
|
@ -3,7 +3,7 @@ Schema = juggling.Schema
|
|||
Text = Schema.Text
|
||||
|
||||
DBNAME = process.env.DBNAME || 'myapp_test' #this db must already exist and will be destroyed
|
||||
DBUSER = process.env.DBUSER || 'root'
|
||||
DBUSER = process.env.DBUSER || 'postgres'
|
||||
DBPASS = ''
|
||||
DBENGINE = process.env.DBENGINE || 'postgres'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ Schema = juggling.Schema
|
|||
Text = Schema.Text
|
||||
|
||||
DBNAME = process.env.DBNAME || 'myapp_test' #this db must already exist and will be destroyed
|
||||
DBUSER = process.env.DBUSER || 'root'
|
||||
DBUSER = process.env.DBUSER || 'postgres'
|
||||
DBPASS = ''
|
||||
DBENGINE = process.env.DBENGINE || 'postgres'
|
||||
|
||||
|
|
Loading…
Reference in New Issue