.
This commit is contained in:
38
server/migrations/20190605135434-create-comment.js
Normal file
38
server/migrations/20190605135434-create-comment.js
Normal file
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.createTable('comments', {
|
||||
id: {
|
||||
allowNull: false,
|
||||
autoIncrement: true,
|
||||
primaryKey: true,
|
||||
type: Sequelize.INTEGER
|
||||
},
|
||||
eventId: {
|
||||
type: Sequelize.INTEGER,
|
||||
references: {
|
||||
model: 'event',
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
activitypub_id: {
|
||||
type: Sequelize.BIGINT,
|
||||
index: true,
|
||||
},
|
||||
data: {
|
||||
type: Sequelize.JSON
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
}
|
||||
});
|
||||
},
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.dropTable('comments');
|
||||
}
|
||||
};
|
||||
45
server/migrations/20190605141112-create-user.js
Normal file
45
server/migrations/20190605141112-create-user.js
Normal file
@@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.createTable('users', {
|
||||
id: {
|
||||
allowNull: false,
|
||||
autoIncrement: true,
|
||||
primaryKey: true,
|
||||
type: Sequelize.INTEGER
|
||||
},
|
||||
email: {
|
||||
type: Sequelize.STRING,
|
||||
unique: { msg: 'err.register_error' },
|
||||
index: true,
|
||||
allowNull: false
|
||||
},
|
||||
description: {
|
||||
type: Sequelize.TEXT
|
||||
},
|
||||
password: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
recover_code: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
is_admin: {
|
||||
type: Sequelize.BOOLEAN
|
||||
},
|
||||
is_active: {
|
||||
type: Sequelize.BOOLEAN
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
}
|
||||
});
|
||||
},
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.dropTable('users');
|
||||
}
|
||||
};
|
||||
66
server/migrations/20190605141850-create-event.js
Normal file
66
server/migrations/20190605141850-create-event.js
Normal file
@@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.createTable('events', {
|
||||
id: {
|
||||
allowNull: false,
|
||||
autoIncrement: true,
|
||||
primaryKey: true,
|
||||
type: Sequelize.INTEGER
|
||||
},
|
||||
title: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
slug: {
|
||||
type: Sequelize.STRING,
|
||||
index: true,
|
||||
},
|
||||
description: {
|
||||
type: Sequelize.TEXT
|
||||
},
|
||||
multidate: {
|
||||
type: Sequelize.BOOLEAN
|
||||
},
|
||||
start_datetime: {
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
end_datetime: {
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
image_path: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
is_visible: {
|
||||
type: Sequelize.BOOLEAN
|
||||
},
|
||||
activitypub_id: {
|
||||
type: Sequelize.BIGINT
|
||||
},
|
||||
userId: {
|
||||
type: Sequelize.INTEGER,
|
||||
references: {
|
||||
model: 'users',
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
placeId: {
|
||||
type: Sequelize.INTEGER,
|
||||
references: {
|
||||
model: 'places',
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
}
|
||||
});
|
||||
},
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.dropTable('events');
|
||||
}
|
||||
};
|
||||
33
server/migrations/20190605142103-create-place.js
Normal file
33
server/migrations/20190605142103-create-place.js
Normal file
@@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.createTable('places', {
|
||||
id: {
|
||||
allowNull: false,
|
||||
autoIncrement: true,
|
||||
primaryKey: true,
|
||||
type: Sequelize.INTEGER
|
||||
},
|
||||
name: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
address: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
weigth: {
|
||||
type: Sequelize.INTEGER
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
}
|
||||
});
|
||||
},
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.dropTable('places');
|
||||
}
|
||||
};
|
||||
37
server/migrations/20190605142152-create-notification.js
Normal file
37
server/migrations/20190605142152-create-notification.js
Normal file
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.createTable('notifications', {
|
||||
id: {
|
||||
allowNull: false,
|
||||
autoIncrement: true,
|
||||
primaryKey: true,
|
||||
type: Sequelize.INTEGER
|
||||
},
|
||||
filters: {
|
||||
type: Sequelize.JSON
|
||||
},
|
||||
email: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
remove_code: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
type: {
|
||||
type: Sequelize.ENUM,
|
||||
values: ['mail', 'admin_email', 'mastodon']
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
}
|
||||
});
|
||||
},
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.dropTable('notifications');
|
||||
}
|
||||
};
|
||||
29
server/migrations/20190605142317-create-tag.js
Normal file
29
server/migrations/20190605142317-create-tag.js
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.createTable('tags', {
|
||||
tag: {
|
||||
type: Sequelize.STRING,
|
||||
allowNull: false,
|
||||
primaryKey: true
|
||||
},
|
||||
weigth: {
|
||||
type: Sequelize.INTEGER
|
||||
},
|
||||
color: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
}
|
||||
});
|
||||
},
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.dropTable('tags');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.createTable('event_notification', {
|
||||
eventId: {
|
||||
type: Sequelize.INTEGER,
|
||||
references: {
|
||||
model: 'events',
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
notificationId: {
|
||||
type: Sequelize.INTEGER,
|
||||
references: {
|
||||
model: 'notifications',
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
status: {
|
||||
type: Sequelize.ENUM,
|
||||
values: ['new', 'sent', 'error'],
|
||||
defaultValue: 'new',
|
||||
index: true
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
}
|
||||
});
|
||||
},
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.dropTable('event_notification');
|
||||
}
|
||||
};
|
||||
27
server/migrations/20190605142619-create-setting.js
Normal file
27
server/migrations/20190605142619-create-setting.js
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.createTable('settings', {
|
||||
key: {
|
||||
type: Sequelize.STRING,
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
index: true,
|
||||
},
|
||||
value: {
|
||||
type: Sequelize.JSON
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
}
|
||||
});
|
||||
},
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.dropTable('settings');
|
||||
}
|
||||
};
|
||||
32
server/migrations/20190605160024-create-event-tag.js
Normal file
32
server/migrations/20190605160024-create-event-tag.js
Normal file
@@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.createTable('event_tags', {
|
||||
eventId: {
|
||||
type: Sequelize.INTEGER,
|
||||
references: {
|
||||
model: 'events',
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
tagTag: {
|
||||
type: Sequelize.STRING,
|
||||
references: {
|
||||
model: 'tags',
|
||||
key: 'tag'
|
||||
}
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE
|
||||
}
|
||||
});
|
||||
},
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.dropTable('event_tags');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user