-
Notifications
You must be signed in to change notification settings - Fork 0
/
usulanDDL
124 lines (100 loc) · 3.85 KB
/
usulanDDL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
-- phpMyAdmin SQL Dump
-- version 4.1.6
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 07 Sep 2014 pada 11.51
-- Versi Server: 5.6.16
-- PHP Version: 5.5.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `accounting`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `accounting_transaction`
--
CREATE TABLE IF NOT EXISTS `accounting_transaction` (
`transaction_id` varchar(10) NOT NULL,
`transaction_date` date NOT NULL,
`entry_date` date NOT NULL,
`description` varchar(50) NOT NULL,
`transaction_type_id` varchar(10) NOT NULL,
PRIMARY KEY (`transaction_id`),
KEY `transaction_id` (`transaction_id`),
KEY `transaction_type_id` (`transaction_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `accounting_transaction_type`
--
CREATE TABLE IF NOT EXISTS `accounting_transaction_type` (
`transaction_type_id` varchar(10) NOT NULL,
`description` varchar(100) NOT NULL,
PRIMARY KEY (`transaction_type_id`),
KEY `description` (`description`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `general_ledger_account`
--
CREATE TABLE IF NOT EXISTS `general_ledger_account` (
`gl_account_id` varchar(10) NOT NULL,
`description` varchar(100) NOT NULL,
PRIMARY KEY (`gl_account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `organization_gl_account_balance`
--
CREATE TABLE IF NOT EXISTS `organization_gl_account_balance` (
`org_gl_id` varchar(10) NOT NULL,
`amount` int(100) NOT NULL,
`gl_account_id` varchar(10) NOT NULL,
PRIMARY KEY (`org_gl_id`),
KEY `gl_account_id` (`gl_account_id`),
KEY `gl_account_id_2` (`gl_account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `transaction_detail`
--
CREATE TABLE IF NOT EXISTS `transaction_detail` (
`transaction_detail_seq_id` varchar(10) NOT NULL,
`amount` int(100) NOT NULL,
`debit_credit_flag` char(1) NOT NULL,
`transaction_id` varchar(10) NOT NULL,
`org_gl_id` varchar(10) NOT NULL,
PRIMARY KEY (`transaction_detail_seq_id`),
KEY `transaction_id` (`transaction_id`),
KEY `transaction_id_2` (`transaction_id`),
KEY `transaction_id_3` (`transaction_id`),
KEY `ogr_gl_id` (`org_gl_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
--
--
-- Ketidakleluasaan untuk tabel `accounting_transaction`
--
ALTER TABLE `accounting_transaction`
ADD CONSTRAINT `fk_trans_transtype` FOREIGN KEY (`transaction_type_id`) REFERENCES `accounting_transaction_type` (`transaction_type_id`);
--
-- Ketidakleluasaan untuk tabel `organization_gl_account_balance`
--
ALTER TABLE `organization_gl_account_balance`
ADD CONSTRAINT `fk_orgGL_generalLedger` FOREIGN KEY (`gl_account_id`) REFERENCES `general_ledger_account` (`gl_account_id`);
--
-- Ketidakleluasaan untuk tabel `transaction_detail`
--
ALTER TABLE `transaction_detail`
ADD CONSTRAINT `fk_trans_detail_orgGL` FOREIGN KEY (`org_gl_id`) REFERENCES `organization_gl_account_balance` (`org_gl_id`),
ADD CONSTRAINT `fk_trans_transdetail` FOREIGN KEY (`transaction_id`) REFERENCES `accounting_transaction` (`transaction_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;