Add Realm base
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
22
src/database/tag.ts
Normal file
22
src/database/tag.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Realm } from '@realm/react';
|
||||
import { Meme } from './meme';
|
||||
|
||||
class Tag extends Realm.Object<Tag> {
|
||||
id!: Realm.BSON.UUID;
|
||||
name!: string;
|
||||
color!: string;
|
||||
memes!: Realm.List<Meme>;
|
||||
|
||||
static schema: Realm.ObjectSchema = {
|
||||
name: 'Tag',
|
||||
primaryKey: 'id',
|
||||
properties: {
|
||||
id: 'uuid',
|
||||
name: 'string',
|
||||
color: 'string',
|
||||
memes: 'Meme[]',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export { Tag };
|
Reference in New Issue
Block a user