Skip to content

Commit 77dbc73

Browse files
committed
conteudo da aula 02
1 parent 2d15aff commit 77dbc73

File tree

11 files changed

+9155
-0
lines changed

11 files changed

+9155
-0
lines changed

Diff for: .babelrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": {
7+
"node": "current"
8+
}
9+
}
10+
]
11+
]
12+
}

Diff for: .sequelizerc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const path = require("path");
2+
3+
module.exports = {
4+
config: path.resolve("src", "config", "config.js"),
5+
"models-path": path.resolve("src", "models"),
6+
"seeders-path": path.resolve("database", "seeders"),
7+
"migrations-path": path.resolve("database", "migration"),
8+
};

Diff for: .vscode/extensions.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"orta.vscode-jest",
4+
"esbenp.prettier-vscode",
5+
"mtxr.sqltools",
6+
"mtxr.sqltools-driver-pg"
7+
]
8+
}

Diff for: database/migration/20240815191333-v0.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'use strict';
2+
/** @type {import('sequelize-cli').Migration} */
3+
module.exports = {
4+
async up(queryInterface, Sequelize) {
5+
await queryInterface.createTable('mensagens', {
6+
id: {
7+
type: Sequelize.DataTypes.UUID,
8+
primaryKey: true,
9+
defaultValue: Sequelize.DataTypes.UUID,
10+
},
11+
usuario: {
12+
type: Sequelize.DataTypes.STRING(20),
13+
allowNull: false,
14+
},
15+
conteudo: {
16+
type: Sequelize.DataTypes.STRING(150),
17+
allowNull: false,
18+
},
19+
gostei: {
20+
type: Sequelize.DataTypes.INTEGER,
21+
defaultValue: 0
22+
},
23+
created_at: {
24+
allowNull: false,
25+
type: Sequelize.Sequelize.DATE
26+
},
27+
updated_at: {
28+
allowNull: false,
29+
type: Sequelize.DATE
30+
}
31+
});
32+
},
33+
async down(queryInterface, Sequelize) {
34+
await queryInterface.dropTable('mensagems');
35+
}
36+
};

0 commit comments

Comments
 (0)