mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-19 03:29:37 +02:00
Modified models to support resource visibility. Added migration
This commit is contained in:
parent
08afaece2e
commit
ee9aefa4fa
4 changed files with 114 additions and 60 deletions
|
@ -1,25 +1,34 @@
|
|||
const { DataTypes } = require('sequelize');
|
||||
const { sequelize } = require('../db');
|
||||
|
||||
const Bookmark = sequelize.define('Bookmark', {
|
||||
name: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false
|
||||
const Bookmark = sequelize.define(
|
||||
'Bookmark',
|
||||
{
|
||||
name: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
url: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
categoryId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
icon: {
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: '',
|
||||
},
|
||||
isPublic: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
defaultValue: 0,
|
||||
},
|
||||
},
|
||||
url: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false
|
||||
},
|
||||
categoryId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false
|
||||
},
|
||||
icon: {
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: ''
|
||||
{
|
||||
tableName: 'bookmarks',
|
||||
}
|
||||
}, {
|
||||
tableName: 'bookmarks'
|
||||
});
|
||||
);
|
||||
|
||||
module.exports = Bookmark;
|
||||
module.exports = Bookmark;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue