1
0
mirror of https://github.com/ebosas/microservices.git synced 2024-11-24 08:02:24 +02:00

Create table for AWS RDS

This commit is contained in:
ebosas 2021-10-27 09:32:24 +03:00
parent 1e1ec146a1
commit df8b7ad56f

View File

@ -25,6 +25,12 @@ func main() {
}
defer connPG.Close(context.Background())
// The table is not created when deployed on AWS RDS.
_, err = connPG.Exec(context.Background(), "create table if not exists messages (id serial primary key, message text not null, created timestamp not null)")
if err != nil {
log.Fatalf("create table: %s", err)
}
// RabbitMQ connection
connMQ, err := rabbit.GetConn(conf.RabbitURL)
if err != nil {