Last active
May 25, 2022 11:47
-
-
Save taufik-nurrohman/7e4fb925ad6f56e446f0cf80d3d52ccf to your computer and use it in GitHub Desktop.
Dummy database.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Tabel Daftar Transaksi | |
CREATE TABLE "inventory" ( | |
"product" INTEGER, -- `product.id` | |
"price" INTEGER, -- Harga satuan produk | |
"quantity" INTEGER, | |
"store" INTEGER, -- `store.id` | |
"time" TEXT, -- Waktu terjadi transaksi | |
"type" INTEGER, -- Tipe transaksi | |
"user" INTEGER | |
); | |
-- Tabel Definisi Produk | |
CREATE TABLE "product" ( | |
"content" TEXT, | |
"description" TEXT, | |
"id" INTEGER PRIMARY KEY, | |
"name" TEXT, | |
"price" INTEGER, -- Harga produk global | |
"quantity" INTEGER, -- Jumlah item per stok | |
"stock" INTEGER, -- Jumlah barang (harus berkurang setiap kali pembelian) | |
"time" TEXT, -- Awal pembuatan data produk | |
"title" TEXT, | |
"touch" TEXT, -- Akhir pembaruan data produk | |
"type" INTEGER, | |
"user" INTEGER | |
); | |
-- Tabel Toko Mitra dan Cabang | |
CREATE TABLE "store" ( | |
"content" TEXT, | |
"description" TEXT, | |
"id" INTEGER PRIMARY KEY, -- Untuk referensi | |
"name" TEXT, | |
"parent" INTEGER, -- Kalau ada data ini berarti toko ini merupakan cabang dari toko dengan `id` yang sama dengan nilai data ini | |
"time" TEXT, | |
"title" TEXT, | |
"user" INTEGER | |
); | |
-- Tabel Tipe Produk/Transaksi | |
CREATE TABLE "type" ( | |
"id" INTEGER, | |
"name" TEXT, | |
"time" TEXT, -- Awal pembuatan data produk/transaksi | |
"title" TEXT, | |
"touch" TEXT, -- Akhir pembaruan data produk | |
"user" INTEGER | |
); | |
-- Tabel Pengguna | |
CREATE TABLE "user" (); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Berarti yang punya kuasa utk ngatur harga ya parent user mas.