Postgres: Operations, Hooks, OAuth login, Files support (#2528)

* Adds files related tests through fs-adapter with PG

* Schema deletions implementations

* Adds Hooks spec

* Fix test

* Adds support for containsAll (numbers and strings)

* Better support for deleteFields and deleteClass

* Recursive JSON update for authData

* Adds node_modules to travis cache

* Disable temporarily to make tests pass

* Adds _perishable_token support for _User class

* ignore when a table creation fails at init (table exists)

* Adds support for AddUnique and Remove

* PG 9.4 compatible functions

* Re-enable tests

* nit

* Better handling of schema creation race
This commit is contained in:
Florent Vilmart
2016-08-18 18:05:26 -04:00
committed by GitHub
parent 3164b478ea
commit 9ecb9a3595
18 changed files with 350 additions and 130 deletions

View File

@@ -211,7 +211,7 @@ describe('SchemaController', () => {
});
});
it_exclude_dbs(['postgres'])('will resolve class creation races appropriately', done => {
it('will resolve class creation races appropriately', done => {
// If two callers race to create the same schema, the response to the
// race loser should be the same as if they hadn't been racing.
config.database.loadSchema()
@@ -617,7 +617,7 @@ describe('SchemaController', () => {
});
});
it_exclude_dbs(['postgres'])('refuses to delete fields that dont exist', done => {
it('refuses to delete fields that dont exist', done => {
hasAllPODobject().save()
.then(() => config.database.loadSchema())
.then(schema => schema.deleteField('missingField', 'HasAllPOD'))
@@ -628,7 +628,7 @@ describe('SchemaController', () => {
});
});
it_exclude_dbs(['postgres'])('drops related collection when deleting relation field', done => {
it('drops related collection when deleting relation field', done => {
var obj1 = hasAllPODobject();
obj1.save()
.then(savedObj1 => {
@@ -659,7 +659,7 @@ describe('SchemaController', () => {
});
});
it_exclude_dbs(['postgres'])('can delete relation field when related _Join collection not exist', done => {
it('can delete relation field when related _Join collection not exist', done => {
config.database.loadSchema()
.then(schema => {
schema.addClassIfNotExists('NewClass', {
@@ -688,7 +688,13 @@ describe('SchemaController', () => {
})
.then(() => config.database.collectionExists('_Join:relationField:NewClass'))
.then(exist => {
expect(exist).toEqual(false);
on_db('postgres', () => {
// We create the table when creating the column
expect(exist).toEqual(true);
}, () => {
expect(exist).toEqual(false);
});
})
.then(() => schema.deleteField('relationField', 'NewClass', config.database))
.then(() => schema.reloadData())
@@ -705,7 +711,7 @@ describe('SchemaController', () => {
});
});
it_exclude_dbs(['postgres'])('can delete string fields and resave as number field', done => {
it('can delete string fields and resave as number field', done => {
Parse.Object.disableSingleInstance();
var obj1 = hasAllPODobject();
var obj2 = hasAllPODobject();
@@ -733,7 +739,7 @@ describe('SchemaController', () => {
});
});
it_exclude_dbs(['postgres'])('can delete pointer fields and resave as string', done => {
it('can delete pointer fields and resave as string', done => {
Parse.Object.disableSingleInstance();
var obj1 = new Parse.Object('NewClass');
obj1.save()