initial watermelondb

This commit is contained in:
William Blythe
2018-10-24 09:10:53 +11:00
parent dfffc3a268
commit 98113e8807
4 changed files with 33 additions and 0 deletions

View File

@@ -122,6 +122,7 @@
},
"dependencies": {
"@babel/polyfill": "^7.0.0",
"@nozbe/watermelondb": "^0.6.2",
"browserify-zlib-next": "^1.0.1",
"classnames": "^2.2.6",
"coriolis-data": "../coriolis-data",

View File

@@ -0,0 +1,9 @@
import { Model } from '@nozbe/watermelondb';
import { field } from '@nozbe/watermelondb/decorators';
export default class Build extends Model {
static table = 'builds'
@field('title') title
@field('code') code
@field('shipId') shipId
}

View File

@@ -0,0 +1,8 @@
import { appSchema, tableSchema } from '@nozbe/watermelondb';
export const buildSchema = appSchema({
version: 1,
tables: [
// tableSchemas go here...
]
});

View File

@@ -0,0 +1,15 @@
import { appSchema, tableSchema } from '@nozbe/watermelondb';
export const mySchema = appSchema({
version: 2,
tables: [
tableSchema({
name: 'builds',
columns: [
{ name: 'title', type: 'string' },
{ name: 'code', type: 'string' },
{ name: 'shipId', type: 'string' }
]
})
]
});