Add Realm base

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2023-07-08 19:07:31 +03:00
parent 3cdf3c2295
commit c1c22145b2
7 changed files with 103 additions and 30 deletions

22
src/database/tag.ts Normal file
View 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 };