Chuỗi bài: Go
sql
39 dòng
· Cập nhật 2026-04-18
seed_data.sql
Go/Baasid/scripts/seed_data.sql
-- Baasid v1.1 — sample data for local development / demo
--
-- Default login (change in production!):
-- account : admin
-- password : password
--
-- The bcrypt hash below was generated with Go's golang.org/x/crypto/bcrypt
-- (cost 10) for the plaintext "password". You can rotate it by running:
--
-- go run ./cmd/hashpw password
--
-- (Add hashpw utility if you want — for now the hash is embedded.)
INSERT INTO system_user ("_id", account, password, name)
VALUES (
'11111111-1111-1111-1111-111111111111',
'admin',
-- bcrypt hash of the string "password" (same as Laravel default hash)
'$2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',
'系統管理員'
)
ON CONFLICT (account) DO NOTHING;
-- Optional second user for multi-tenant experiments
INSERT INTO system_user ("_id", account, password, name)
VALUES (
'22222222-2222-2222-2222-222222222222',
'demo',
'$2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',
'Demo User'
)
ON CONFLICT (account) DO NOTHING;
-- Sample goods rows (created / updated by admin user)
INSERT INTO goods ("_id", name, cr_user, up_user)
VALUES
('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '示範商品 A', '11111111-1111-1111-1111-111111111111', '11111111-1111-1111-1111-111111111111'),
('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', '示範商品 B', '11111111-1111-1111-1111-111111111111', '11111111-1111-1111-1111-111111111111')
ON CONFLICT ("_id") DO NOTHING;
Bài viết liên quan
Go
go
Cập nhật 2026-04-18
main.go
main.go — go source code from the Go learning materials (Go/Baasid/cmd/hashpw/main.go).
Đọc bài viết →
Go
go
Cập nhật 2026-04-18
main.go
main.go — go source code from the Go learning materials (Go/Baasid/cmd/server/main.go).
Đọc bài viết →
Go
go
Cập nhật 2026-04-18
docs.go
docs.go — go source code from the Go learning materials (Go/Baasid/docs/docs.go).
Đọc bài viết →
Go
go
Cập nhật 2026-04-18
jwt.go
jwt.go — go source code from the Go learning materials (Go/Baasid/internal/auth/jwt.go).
Đọc bài viết →
Go
go
Cập nhật 2026-04-18
password.go
password.go — go source code from the Go learning materials (Go/Baasid/internal/auth/password.go).
Đọc bài viết →
Go
go
Cập nhật 2026-04-18
password_test.go
password_test.go — go source code from the Go learning materials (Go/Baasid/internal/auth/password_test.go).
Đọc bài viết →