Serie: Go
sql
18 líneas
· Actualizado 2026-04-18
create_tables.sql
Go/payment-gateway-challenge/scripts/create_tables.sql
-- Optional explicit DDL (the Go app also runs GORM AutoMigrate on startup).
-- UUID primary keys use PostgreSQL built-in gen_random_uuid() (PG 13+).
CREATE TABLE IF NOT EXISTS payments (
id uuid PRIMARY KEY,
status varchar(20) NOT NULL,
card_last_four varchar(4) NOT NULL,
card_number_length integer NOT NULL,
expiry_month integer NOT NULL,
expiry_year integer NOT NULL,
currency varchar(3) NOT NULL,
amount bigint NOT NULL,
authorization_code varchar(64),
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_payments_status ON payments (status);
CREATE INDEX IF NOT EXISTS idx_payments_created_at ON payments (created_at);
Artículos relacionados
Go
go
Actualizado 2026-04-18
main.go
main.go — go source code from the Go learning materials (Go/Baasid/cmd/hashpw/main.go).
Leer artículo →
Go
go
Actualizado 2026-04-18
main.go
main.go — go source code from the Go learning materials (Go/Baasid/cmd/server/main.go).
Leer artículo →
Go
go
Actualizado 2026-04-18
docs.go
docs.go — go source code from the Go learning materials (Go/Baasid/docs/docs.go).
Leer artículo →
Go
go
Actualizado 2026-04-18
jwt.go
jwt.go — go source code from the Go learning materials (Go/Baasid/internal/auth/jwt.go).
Leer artículo →
Go
go
Actualizado 2026-04-18
password.go
password.go — go source code from the Go learning materials (Go/Baasid/internal/auth/password.go).
Leer artículo →
Go
go
Actualizado 2026-04-18
password_test.go
password_test.go — go source code from the Go learning materials (Go/Baasid/internal/auth/password_test.go).
Leer artículo →