12345678910111213141516171819202122232425262728293031323334353637 |
- package migrations
- import (
- "database/sql"
- "github.com/pressly/goose"
- )
- func init() {
- goose.AddMigration(Up20181117121947, Down20181117121947)
- }
- func Up20181117121947(tx *sql.Tx) error {
- return simpleRun(tx, strings{
- `
- DROP TABLE IF EXISTS map;
- `, `
- CREATE TABLE map (
- hash bigint(20) UNSIGNED NOT NULL DEFAULT 0,
- url varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- date1 datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
- date2 datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
- date3 datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
- refcount int(11) NOT NULL DEFAULT 0
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
- `, `
- ALTER TABLE map
- ADD PRIMARY KEY (hash);
- `,
- })
- }
- func Down20181117121947(tx *sql.Tx) error {
- return simpleRun(tx, strings{`
- DROP TABLE IF EXISTS map;
- `})
- }
|