Skip to content

Instantly share code, notes, and snippets.

@ianpward
Last active May 18, 2018 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianpward/727e93e8ec8e85218f0231ed1fb5ebfc to your computer and use it in GitHub Desktop.
Save ianpward/727e93e8ec8e85218f0231ed1fb5ebfc to your computer and use it in GitHub Desktop.
Javascript file that maps Realm objects to Postgres schema
const Bus = {
name: 'Bus',
primaryKey: 'vehicle',
properties: {
Scheduleid: {type: 'Schedule'},
vehicle: 'int',
fleet_id: { type: 'string', optional: true },
last_main: { type: 'date', optional: true }
}
};
const Driver = {
name: 'Driver',
primaryKey: 'id',
properties: {
Busvehicle: {type: 'Bus'},
id: 'int',
name: { type: 'string', optional: true },
employ_date: { type: 'date', optional: true }
}
};
const Schedule = {
name: 'Schedule',
primaryKey: 'id',
properties: {
id: 'int',
Routeid: {type: 'Route'},
departure: { type: 'date', optional: true },
arrival: { type: 'date', optional: true }
}
};
const Route = {
name: 'Route',
primaryKey: 'id',
properties: {
id: 'string'
}
};
module.exports = [
Bus,
Driver,
Schedule,
Route
];
@mgeerling
Copy link

looks like there is an issue in line 5 of this gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment