Browse Source

Postgres integration

master
ss.pedroisac 5 years ago
parent
commit
a2876ea978
16 changed files with 70683 additions and 68158 deletions
  1. +1
    -1
      User/state/24ce6c0.json
  2. +1
    -0
      User/state/57447972.json
  3. +1
    -1
      User/state/global.json
  4. +4
    -0
      User/workspaceStorage/57447972/meta.json
  5. +15
    -4
      config/_development.json
  6. BIN
      dbs/social.mv.db
  7. +48
    -0
      dbs/social.trace.db
  8. +70203
    -68148
      public/scripts/main.js
  9. +1
    -1
      public/scripts/main.js.map
  10. +0
    -0
      server/services/api/communities/detail.get.js
  11. +37
    -0
      server/setup/002-cidade.js
  12. +110
    -0
      server/setup/003-pessoa.js
  13. +47
    -0
      server/setup/004-comunidade.js
  14. +161
    -0
      server/setup/005-publicao.js
  15. +51
    -0
      server/setup/006-pessoa-comunidade.js
  16. +3
    -3
      server/setup/_start.js

+ 1
- 1
User/state/24ce6c0.json
File diff suppressed because it is too large
View File


+ 1
- 0
User/state/57447972.json
File diff suppressed because it is too large
View File


+ 1
- 1
User/state/global.json
File diff suppressed because it is too large
View File


+ 4
- 0
User/workspaceStorage/57447972/meta.json View File

@ -0,0 +1,4 @@
{
"id": "57447972",
"name": "social_netuno"
}

+ 15
- 4
config/_development.json View File

@ -2,7 +2,7 @@
"cron": {"jobs": []}, "cron": {"jobs": []},
"settings": {"public": {}}, "settings": {"public": {}},
"smtp": {}, "smtp": {},
"name": "social",
"name": "social_netuno",
"setup": { "setup": {
"schema": { "schema": {
"execution": true, "execution": true,
@ -25,7 +25,16 @@
"command": "npm run watch", "command": "npm run watch",
"enabled": true "enabled": true
}], }],
"db": {"default": {
"db": {
"default": {
"engine": "pg",
"port": "5432",
"host": "localhost",
"name": "app_db",
"username": "app_user",
"password": "S3cR3t"
},
"antiga":{
"password": "", "password": "",
"engine": "h2", "engine": "h2",
"port": "", "port": "",
@ -39,7 +48,9 @@
"origins": [ "origins": [
"http://pedro-isac.dev.netuno.org:30730", "http://pedro-isac.dev.netuno.org:30730",
"http://localhost:3000", "http://localhost:3000",
"http://127.0.0.1:3000"
"http://127.0.0.1:3000",
"https://pedro-cors.herokuapp.com"
] ]
} }
], ],
@ -50,4 +61,4 @@
"refresh_expires": 1440, "refresh_expires": 1440,
"algorithm": "HS512" "algorithm": "HS512"
} }
}
}

BIN
dbs/social.mv.db View File


+ 48
- 0
dbs/social.trace.db View File

@ -3259,3 +3259,51 @@ SELECT pessoa.*, cidade.nome AS cidade
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834) at java.base/java.lang.Thread.run(Thread.java:834)
2021-04-25 14:45:01 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Data conversion error converting "social-netuno"; SQL statement:
select * from netuno_app where uid = 'social-netuno' [22018-198]
2021-04-25 14:47:49 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Data conversion error converting "social-netuno"; SQL statement:
select * from netuno_app where uid = 'social-netuno' [22018-198]
2021-04-25 21:58:18 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Data conversion error converting "social-netuno"; SQL statement:
select * from netuno_app where uid = 'social-netuno' [22018-198]
2021-04-25 22:05:08 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Data conversion error converting "social-netuno"; SQL statement:
select * from netuno_app where uid = 'social-netuno' [22018-198]
2021-04-26 10:14:53 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Data conversion error converting "social-netuno"; SQL statement:
select * from netuno_app where uid = 'social-netuno' [22018-198]
2021-04-26 11:49:35 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Data conversion error converting "social-netuno"; SQL statement:
select * from netuno_app where uid = 'social-netuno' [22018-198]
2021-04-26 12:25:54 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Data conversion error converting "social-netuno"; SQL statement:
select * from netuno_app where uid = 'social-netuno' [22018-198]
2021-04-26 13:08:08 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "null[*]"; SQL statement:
null [42000-198]
2021-04-26 13:29:17 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "null[*]"; SQL statement:
null [42000-198]
2021-04-26 13:31:31 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "null[*]"; SQL statement:
null [42000-198]
2021-04-26 13:40:43 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "null[*]"; SQL statement:
null [42000-198]
2021-04-26 14:07:45 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "sle[*]"; expected "SET, SAVEPOINT, SCRIPT, SHUTDOWN, SHOW"; SQL statement:
sle [42001-198]
2021-04-26 14:09:24 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "sel[*]"; expected "SET, SAVEPOINT, SCRIPT, SHUTDOWN, SHOW"; SQL statement:
sel [42001-198]
2021-04-26 14:12:03 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "sel[*]"; expected "SET, SAVEPOINT, SCRIPT, SHUTDOWN, SHOW"; SQL statement:
sel [42001-198]
2021-04-26 14:18:29 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "null[*]"; SQL statement:
null [42000-198]
2021-04-26 22:28:24 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Data conversion error converting "social-netuno"; SQL statement:
select * from netuno_app where uid = 'social-netuno' [22018-198]

+ 70203
- 68148
public/scripts/main.js
File diff suppressed because it is too large
View File


+ 1
- 1
public/scripts/main.js.map
File diff suppressed because it is too large
View File


+ 0
- 0
server/services/api/communities/detail.get.js View File


+ 37
- 0
server/setup/002-cidade.js View File

@ -0,0 +1,37 @@
// -----------------------------------------------------------
//
// CIDADE
//
// -----------------------------------------------------------
//
// CODE GENERATED AUTOMATICALLY
//
_db.insertIfNotExists(
"cidade",
_val.init()
.set("uid", "e2e32bc9-e25e-4073-8b08-357aaa6f11f6")
.set("nome", "S\u00E3o Luis")
);
_db.insertIfNotExists(
"cidade",
_val.init()
.set("uid", "3fa22855-0443-4944-b53c-371d08938104")
.set("nome", "Salvador")
);
_db.insertIfNotExists(
"cidade",
_val.init()
.set("uid", "10f183aa-d58f-4af8-a996-6aecfd3e31dc")
.set("nome", "S\u00E3o Paulo")
);
_db.insertIfNotExists(
"cidade",
_val.init()
.set("uid", "e55c8072-7a95-43c8-a79f-55c58ddb4aef")
.set("nome", "Itapecuru-mirim")
);

+ 110
- 0
server/setup/003-pessoa.js View File

@ -0,0 +1,110 @@
// -----------------------------------------------------------
//
// PESSOA
//
// -----------------------------------------------------------
//
// CODE GENERATED AUTOMATICALLY
//
_db.insertIfNotExists(
"pessoa",
_val.init()
.set("uid", "60596f2c-a697-4a52-af32-961b9effc1c8")
.set("nome", "Pedro")
.set("sobrenome", "Isac")
.set("email", "ss.pedroisac@gmail.com")
.set("cidade_id", "e2e32bc9-e25e-4073-8b08-357aaa6f11f6")
.set("usuario_id", 0)
);
_db.insertIfNotExists(
"pessoa",
_val.init()
.set("uid", "4fd361d2-fcbd-4381-ab4c-7e146db488e6")
.set("nome", "Jo\u00E3o")
.set("sobrenome", "Silva")
.set("email", "joao.silva@gmail.com")
.set("cidade_id", "10f183aa-d58f-4af8-a996-6aecfd3e31dc")
.set("usuario_id", 0)
);
_db.insertIfNotExists(
"pessoa",
_val.init()
.set("uid", "3539cf55-e542-4506-a54b-5389dd0f8b57")
.set("nome", "Marial")
.set("sobrenome", "Joaquina")
.set("email", "maria@gmail.com")
.set("cidade_id", "3fa22855-0443-4944-b53c-371d08938104")
.set("usuario_id", 0)
);
_db.insertIfNotExists(
"pessoa",
_val.init()
.set("uid", "46846bef-3614-48fa-b3d3-c4e0f0eb47ce")
.set("nome", "Clara")
.set("sobrenome", "Ara\u00FAjo")
.set("email", "clara@gmail.com")
.set("cidade_id", "10f183aa-d58f-4af8-a996-6aecfd3e31dc")
.set("usuario_id", 0)
);
_db.insertIfNotExists(
"pessoa",
_val.init()
.set("uid", "fde1334e-a003-4ae7-8d54-7b0ed5333276")
.set("nome", "Pedro")
.set("sobrenome", "Isac")
.set("email", "isac@gmail.com")
.set("cidade_id", "e2e32bc9-e25e-4073-8b08-357aaa6f11f6")
.set("usuario_id", 4)
);
_db.insertIfNotExists(
"pessoa",
_val.init()
.set("uid", "8c35a912-e471-4bb0-a70c-520949d94628")
.set("nome", "Pedro")
.set("sobrenome", "Isac")
.set("email", "grgesac@gmail.com")
.set("cidade_id", "e2e32bc9-e25e-4073-8b08-357aaa6f11f6")
.set("usuario_id", 5)
);
_db.insertIfNotExists(
"pessoa",
_val.init()
.set("uid", "07552521-930e-4f21-b00a-f451bf45df45")
.set("nome", "teste")
.set("sobrenome", "teste")
.set("email", "teste@gmail.com")
.set("cidade_id", "e2e32bc9-e25e-4073-8b08-357aaa6f11f6")
.set("usuario_id", 6)
);
_db.insertIfNotExists(
"pessoa",
_val.init()
.set("uid", "73526288-e16a-45b2-8565-d9ba7fee2910")
.set("nome", "Pedro")
.set("sobrenome", "Isac")
.set("email", "pedroisac@gmail.com")
.set("cidade_id", "e2e32bc9-e25e-4073-8b08-357aaa6f11f6")
.set("usuario_id", 7)
);
_db.insertIfNotExists(
"pessoa",
_val.init()
.set("uid", "3eaf2dfd-058c-4996-9ddd-797c15c7f028")
.set("nome", "Pedro")
.set("sobrenome", "Isac")
.set("email", "pedro@pedro.com")
.set("cidade_id", "e2e32bc9-e25e-4073-8b08-357aaa6f11f6")
.set("usuario_id", 8)
);

+ 47
- 0
server/setup/004-comunidade.js View File

@ -0,0 +1,47 @@
// -----------------------------------------------------------
//
// COMUNIDADE
//
// -----------------------------------------------------------
//
// CODE GENERATED AUTOMATICALLY
//
_db.insertIfNotExists(
"comunidade",
_val.init()
.set("uid", "3ba722d1-0a5f-47f4-a775-8f8c0a1a0649")
.set("nome", "Corinthians")
.set("imagem", "")
.set("cidade_id", "10f183aa-d58f-4af8-a996-6aecfd3e31dc")
);
_db.insertIfNotExists(
"comunidade",
_val.init()
.set("uid", "00b6d9e5-d6ac-40b7-a31b-9f091e0d2647")
.set("nome", "Sampaio")
.set("imagem", "")
.set("cidade_id", "e2e32bc9-e25e-4073-8b08-357aaa6f11f6")
);
_db.insertIfNotExists(
"comunidade",
_val.init()
.set("uid", "212db7f3-c03e-4b7c-91eb-507eb66b866a")
.set("nome", "Bahia")
.set("imagem", "")
.set("cidade_id", "3fa22855-0443-4944-b53c-371d08938104")
);
_db.insertIfNotExists(
"comunidade",
_val.init()
.set("uid", "392e4296-5d93-4b50-9fba-84ddbf17b3ee")
.set("nome", "Santos")
.set("imagem", "")
.set("cidade_id", "10f183aa-d58f-4af8-a996-6aecfd3e31dc")
);

+ 161
- 0
server/setup/005-publicao.js View File

@ -0,0 +1,161 @@
// -----------------------------------------------------------
//
// PUBLICACAO
//
// -----------------------------------------------------------
//
// CODE GENERATED AUTOMATICALLY
//
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "655c1668-3636-49b0-aa4c-9be889e6af3f")
.set("comunidade_id", "3ba722d1-0a5f-47f4-a775-8f8c0a1a0649")
.set("mensagem", "Jogo hoje as 19:00")
.set("momento", _db.timestamp("2021-04-01 05:20:00.0"))
.set("pessoa_id", "60596f2c-a697-4a52-af32-961b9effc1c8")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "a0474547-3a3b-4868-bd1c-bcab73727be3")
.set("comunidade_id", "00b6d9e5-d6ac-40b7-a31b-9f091e0d2647")
.set("mensagem", "Ol\u00E1 pessoal")
.set("momento", _db.timestamp("2021-04-03 19:35:00.0"))
.set("pessoa_id", "3539cf55-e542-4506-a54b-5389dd0f8b57")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "a7e9061c-d4e0-4fe4-b7a6-bd044b2bb233")
.set("comunidade_id", "3ba722d1-0a5f-47f4-a775-8f8c0a1a0649")
.set("mensagem", "wwwdw")
.set("momento", _db.timestamp("2021-04-02 18:00:00.0"))
.set("pessoa_id", "4fd361d2-fcbd-4381-ab4c-7e146db488e6")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "c6633b56-47b7-43e5-b7d4-7d539ac5c9cd")
.set("comunidade_id", "392e4296-5d93-4b50-9fba-84ddbf17b3ee")
.set("mensagem", "dqwdqwxwqxs\nscomcoc")
.set("momento", _db.timestamp("2021-04-03 07:29:00.0"))
.set("pessoa_id", "4fd361d2-fcbd-4381-ab4c-7e146db488e6")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "965739fd-6705-4420-b80d-5b081ad312e3")
.set("comunidade_id", "212db7f3-c03e-4b7c-91eb-507eb66b866a")
.set("mensagem", "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.")
.set("momento", _db.timestamp("2021-04-02 07:32:00.0"))
.set("pessoa_id", "4fd361d2-fcbd-4381-ab4c-7e146db488e6")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "f711a501-a17a-4d97-9765-751a06135895")
.set("comunidade_id", "3ba722d1-0a5f-47f4-a775-8f8c0a1a0649")
.set("mensagem", "widhowid")
.set("momento", _db.timestamp("2021-04-01 18:40:00.0"))
.set("pessoa_id", "4fd361d2-fcbd-4381-ab4c-7e146db488e6")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "6310f87d-daf1-48b3-a20a-7db24e5146e6")
.set("comunidade_id", "212db7f3-c03e-4b7c-91eb-507eb66b866a")
.set("mensagem", "wdbiwbdb")
.set("momento", _db.timestamp("2021-04-02 19:33:00.0"))
.set("pessoa_id", "46846bef-3614-48fa-b3d3-c4e0f0eb47ce")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "fffc2684-3024-4d7f-94c5-10a9760471be")
.set("comunidade_id", "212db7f3-c03e-4b7c-91eb-507eb66b866a")
.set("mensagem", "diwion wnwdn")
.set("momento", _db.timestamp("2021-04-02 18:40:00.0"))
.set("pessoa_id", "3539cf55-e542-4506-a54b-5389dd0f8b57")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "42edf3d1-338c-4f6c-a1d0-a3a0256cf89a")
.set("comunidade_id", "212db7f3-c03e-4b7c-91eb-507eb66b866a")
.set("mensagem", "d3mo3o 3omd3d")
.set("momento", _db.timestamp("2021-04-03 18:35:00.0"))
.set("pessoa_id", "60596f2c-a697-4a52-af32-961b9effc1c8")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "0d2bee19-e6aa-45a8-8802-32daff4a0a57")
.set("comunidade_id", "392e4296-5d93-4b50-9fba-84ddbf17b3ee")
.set("mensagem", "3e3ine")
.set("momento", _db.timestamp("2021-04-03 19:32:00.0"))
.set("pessoa_id", "4fd361d2-fcbd-4381-ab4c-7e146db488e6")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "11e1e1e0-372e-4dc6-b3cf-d23a3f5af815")
.set("comunidade_id", "392e4296-5d93-4b50-9fba-84ddbf17b3ee")
.set("mensagem", "enenfoef")
.set("momento", _db.timestamp("2021-04-03 19:35:00.0"))
.set("pessoa_id", "3539cf55-e542-4506-a54b-5389dd0f8b57")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "082bdd8f-f32f-43c9-b208-a6f33d9b3238")
.set("comunidade_id", "212db7f3-c03e-4b7c-91eb-507eb66b866a")
.set("mensagem", "lmlrmfrf")
.set("momento", _db.timestamp("2021-04-01 19:35:00.0"))
.set("pessoa_id", "3539cf55-e542-4506-a54b-5389dd0f8b57")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "eb3f690d-8033-4118-add7-f14e201eb854")
.set("comunidade_id", "392e4296-5d93-4b50-9fba-84ddbf17b3ee")
.set("mensagem", "33e3")
.set("momento", _db.timestamp("2021-04-01 18:32:00.0"))
.set("pessoa_id", "4fd361d2-fcbd-4381-ab4c-7e146db488e6")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "af28ce16-8021-4cb5-84ec-0d6ed624192a")
.set("comunidade_id", "3ba722d1-0a5f-47f4-a775-8f8c0a1a0649")
.set("mensagem", "3e3e")
.set("momento", _db.timestamp("2021-04-02 20:40:00.0"))
.set("pessoa_id", "46846bef-3614-48fa-b3d3-c4e0f0eb47ce")
);
_db.insertIfNotExists(
"publicacao",
_val.init()
.set("uid", "a88de3fa-b027-4747-8d26-dfab54752fe2")
.set("comunidade_id", "392e4296-5d93-4b50-9fba-84ddbf17b3ee")
.set("mensagem", "3e3e3e")
.set("momento", _db.timestamp("2021-04-14 19:35:00.0"))
.set("pessoa_id", "60596f2c-a697-4a52-af32-961b9effc1c8")
);

+ 51
- 0
server/setup/006-pessoa-comunidade.js View File

@ -0,0 +1,51 @@
// -----------------------------------------------------------
//
// PESSOA_COMUNIDADE
//
// -----------------------------------------------------------
//
// CODE GENERATED AUTOMATICALLY
//
_db.insertIfNotExists(
"pessoa_comunidade",
_val.init()
.set("uid", "cf1c38e9-7b6c-40c0-9772-fb174665ecb7")
.set("comunidade_id", "3ba722d1-0a5f-47f4-a775-8f8c0a1a0649")
.set("pessoa_id", "60596f2c-a697-4a52-af32-961b9effc1c8")
);
_db.insertIfNotExists(
"pessoa_comunidade",
_val.init()
.set("uid", "8090614d-3b46-4943-b73f-c2d2e3419deb")
.set("comunidade_id", "3ba722d1-0a5f-47f4-a775-8f8c0a1a0649")
.set("pessoa_id", "4fd361d2-fcbd-4381-ab4c-7e146db488e6")
);
_db.insertIfNotExists(
"pessoa_comunidade",
_val.init()
.set("uid", "f687e8c9-254e-44e9-9bef-a206e74d92ab")
.set("comunidade_id", "212db7f3-c03e-4b7c-91eb-507eb66b866a")
.set("pessoa_id", "3539cf55-e542-4506-a54b-5389dd0f8b57")
);
_db.insertIfNotExists(
"pessoa_comunidade",
_val.init()
.set("uid", "acae9601-ffb3-4348-ae26-8f83619297e8")
.set("comunidade_id", "00b6d9e5-d6ac-40b7-a31b-9f091e0d2647")
.set("pessoa_id", "46846bef-3614-48fa-b3d3-c4e0f0eb47ce")
);
_db.insertIfNotExists(
"pessoa_comunidade",
_val.init()
.set("uid", "b5282454-62b5-4654-a265-a4e1c5dbb2b5")
.set("comunidade_id", "392e4296-5d93-4b50-9fba-84ddbf17b3ee")
.set("pessoa_id", "46846bef-3614-48fa-b3d3-c4e0f0eb47ce")
);

+ 3
- 3
server/setup/_start.js View File

@ -1,3 +1,3 @@
_group.createIfNotExists(
_val.map().set("name", "Usuário comum").set("code", "user")
);
//_group.createIfNotExists(
// _val.map().set("name", "Usuário comum").set("code", "user")
//);

Loading…
Cancel
Save