mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-11 16:53:02 +00:00
initial watermelondb
This commit is contained in:
@@ -122,6 +122,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/polyfill": "^7.0.0",
|
"@babel/polyfill": "^7.0.0",
|
||||||
|
"@nozbe/watermelondb": "^0.6.2",
|
||||||
"browserify-zlib-next": "^1.0.1",
|
"browserify-zlib-next": "^1.0.1",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"coriolis-data": "../coriolis-data",
|
"coriolis-data": "../coriolis-data",
|
||||||
|
|||||||
9
src/app/stores/model/build.js
Normal file
9
src/app/stores/model/build.js
Normal 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
|
||||||
|
}
|
||||||
8
src/app/stores/model/index.js
Normal file
8
src/app/stores/model/index.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { appSchema, tableSchema } from '@nozbe/watermelondb';
|
||||||
|
|
||||||
|
export const buildSchema = appSchema({
|
||||||
|
version: 1,
|
||||||
|
tables: [
|
||||||
|
// tableSchemas go here...
|
||||||
|
]
|
||||||
|
});
|
||||||
15
src/app/stores/model/schema.js
Normal file
15
src/app/stores/model/schema.js
Normal 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' }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user