recreate migration create table users; with unique constrains
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
-- +goose StatementEnd
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
DROP EXTENSION "uuid-ossp";
|
||||
-- +goose StatementEnd
|
||||
+7
-3
@@ -1,16 +1,20 @@
|
||||
-- Active: 1723171055346@@127.0.0.1@5432@postgres@public
|
||||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
DROP TABLE IF EXISTS users;
|
||||
CREATE TABLE IF NOT EXISTS users(
|
||||
id UUID NOT NULL PRIMARY KEY,
|
||||
name VARCHAR(50) NOT NULL,
|
||||
email VARCHAR(50) NOT NULL,
|
||||
email VARCHAR(50) NOT NULL UNIQUE,
|
||||
password VARCHAR(500) NOT NULL,
|
||||
phone VARCHAR(50)
|
||||
phone VARCHAR(50) NOT NULL UNIQUE
|
||||
);
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
CREATE INDEX email_index ON users (email);
|
||||
CREATE INDEX phone_index ON users (phone);
|
||||
-- +goose StatementEnd
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
DROP TABLE IF EXISTS users;
|
||||
DROP EXTENSION IF EXISTS "uuid-ossp";
|
||||
-- +goose StatementEnd
|
||||
Reference in New Issue
Block a user