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:
parent
1e1ec146a1
commit
df8b7ad56f
@ -25,6 +25,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
defer connPG.Close(context.Background())
|
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
|
// RabbitMQ connection
|
||||||
connMQ, err := rabbit.GetConn(conf.RabbitURL)
|
connMQ, err := rabbit.GetConn(conf.RabbitURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user