8558b92cae
* Collection edit modal * Add icon * 💚 * Oh look, some specs * Delete collection * Remove from collection * Handle error responses Protect against deleting last collection * Fix key * 💚 * Keyboard navigate documents list * Add missing database constraints
34 lines
585 B
JavaScript
34 lines
585 B
JavaScript
// @flow
|
|
import { DataTypes, sequelize } from '../sequelize';
|
|
|
|
const Revision = sequelize.define('revision', {
|
|
id: {
|
|
type: DataTypes.UUID,
|
|
defaultValue: DataTypes.UUIDV4,
|
|
primaryKey: true,
|
|
},
|
|
title: DataTypes.STRING,
|
|
text: DataTypes.TEXT,
|
|
html: DataTypes.TEXT,
|
|
preview: DataTypes.TEXT,
|
|
|
|
userId: {
|
|
type: 'UUID',
|
|
allowNull: false,
|
|
references: {
|
|
model: 'users',
|
|
},
|
|
},
|
|
|
|
documentId: {
|
|
type: 'UUID',
|
|
allowNull: false,
|
|
references: {
|
|
model: 'documents',
|
|
onDelete: 'CASCADE',
|
|
},
|
|
},
|
|
});
|
|
|
|
export default Revision;
|