Exemple #1
0
package main

import (
	"github.com/jonasi/pg/migrate"
)

var _ = migrate.Add("002_create_table_two",
	func(db *migrate.DB) error {
		return db.Exec(`create table goodbye ( id int primary key )`)
	},
	func(db *migrate.DB) error {
		return db.Exec(`drop table goodbye`)
	},
)
Exemple #2
0
package main

import (
	"github.com/jonasi/pg/migrate"
)

var _ = migrate.Add("001_create_table",
	func(db *migrate.DB) error {
		return db.Exec(`create table hello ( id int primary key )`)
	},
	func(db *migrate.DB) error {
		return db.Exec(`drop table hello`)
	},
)