Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3bb0b2aa29 |
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "news-server",
|
||||
"version": "1.2.2",
|
||||
"version": "1.3.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "news-server",
|
||||
"version": "1.2.2",
|
||||
"version": "1.3.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"cors": "^2.8.5",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "news-server",
|
||||
"version": "1.2.3",
|
||||
"version": "1.3.0",
|
||||
"description": "An API centric news server. Uses Sequelize and mariaDB by default.",
|
||||
"main": "server/server.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -17,12 +17,15 @@ const revisions = sequelize.define('revisions', {
|
||||
body: {
|
||||
type: Sequelize.TEXT,
|
||||
defaultValue: ''
|
||||
},
|
||||
|
||||
originalIndex: {
|
||||
type: Sequelize.INTEGER(11),
|
||||
default: null
|
||||
}
|
||||
});
|
||||
|
||||
//relationships
|
||||
articles.hasOne(revisions, { as: 'original' });
|
||||
|
||||
sequelize.sync();
|
||||
|
||||
module.exports = revisions;
|
||||
@@ -0,0 +1,6 @@
|
||||
use news;
|
||||
ALTER TABLE revisions CHANGE COLUMN id `index` INTEGER(11) UNIQUE NOT NULL AUTO_INCREMENT;
|
||||
|
||||
ALTER TABLE revisions DROP FOREIGN KEY revisions_ibfk_1;
|
||||
|
||||
ALTER TABLE revisions CHANGE COLUMN originalIndex originalIndex INTEGER(11);
|
||||
Reference in New Issue
Block a user