This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/server/models/Revision.js
Tom Moor 8558b92cae Edit collection (#173)
* 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
2017-08-29 08:37:17 -07:00

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;