Skip to content

Postgres

zelenko edited this page Feb 16, 2021 · 2 revisions

Installing Docker container

  • docker pull postgres
  • mkdir -p $HOME/docker/volumes/postgres
  • docker run --rm --name pg-docker -e POSTGRES_PASSWORD=******* -e TZ="America/New_York" -e PGTZ="America/New_York" -d -p 5432:5432 -v $HOME/docker/volumes/postgres/data:/var/lib/postgresql/data postgres

Gorm config

	db, err := gorm.Open(sqlite.Open("gorm.db"), &gorm.Config{
		NamingStrategy: schema.NamingStrategy{
			TablePrefix:   "t_",
			SingularTable: true,
		},
	})
Clone this wiki locally