Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { appSchema, tableSchema } from '@nozbe/watermelondb'
export const mySchema = appSchema({
version: 2,
tables: [
tableSchema({
name: 'blogs',
columns: [{ name: 'name', type: 'string' }],
}),
tableSchema({
name: 'posts',
columns: [
{ name: 'title', type: 'string' },
{ name: 'subtitle', type: 'string' },
{ name: 'body', type: 'string' },
{ name: 'blog_id', type: 'string', isIndexed: true },
],
}),
tableSchema({
import { appSchema, Database, Model, tableSchema } from '@nozbe/watermelondb';
import LokiJSAdapter from '@nozbe/watermelondb/adapters/lokijs';
import { field } from '@nozbe/watermelondb/decorators';
export const schema = appSchema({
tables: [
tableSchema({
columns: [
{ name: 'text', type: 'string', isIndexed: true },
{ name: 'color', type: 'string', isIndexed: true },
],
name: 'todos',
}),
tableSchema({
columns: [{ name: 'name', type: 'string', isIndexed: true }],
name: 'users',
}),
],
version: 1,
});