Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3bb0b2aa29 |
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "news-server",
|
"name": "news-server",
|
||||||
"version": "1.2.2",
|
"version": "1.3.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "news-server",
|
"name": "news-server",
|
||||||
"version": "1.2.2",
|
"version": "1.3.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "news-server",
|
"name": "news-server",
|
||||||
"version": "1.2.3",
|
"version": "1.3.0",
|
||||||
"description": "An API centric news server. Uses Sequelize and mariaDB by default.",
|
"description": "An API centric news server. Uses Sequelize and mariaDB by default.",
|
||||||
"main": "server/server.js",
|
"main": "server/server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -17,12 +17,15 @@ const revisions = sequelize.define('revisions', {
|
|||||||
body: {
|
body: {
|
||||||
type: Sequelize.TEXT,
|
type: Sequelize.TEXT,
|
||||||
defaultValue: ''
|
defaultValue: ''
|
||||||
|
},
|
||||||
|
|
||||||
|
originalIndex: {
|
||||||
|
type: Sequelize.INTEGER(11),
|
||||||
|
default: null
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//relationships
|
//relationships
|
||||||
articles.hasOne(revisions, { as: 'original' });
|
|
||||||
|
|
||||||
sequelize.sync();
|
sequelize.sync();
|
||||||
|
|
||||||
module.exports = revisions;
|
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