Created
August 2, 2020 07:26
-
-
Save radityopw/93732a9e895f325ea56f1ba1e4fc6c1b to your computer and use it in GitHub Desktop.
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
CREATE TABLE [dbo].[pegawai]( | |
[id] [int] IDENTITY(1,1) NOT NULL, | |
[nama] [varchar](20) NOT NULL, | |
[jenis_kelamin] [char](1) NOT NULL, | |
[create_at] [datetime] NOT NULL, | |
[update_at] [datetime] NOT NULL, | |
CONSTRAINT [PK_pegawai] PRIMARY KEY CLUSTERED | |
( | |
[id] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] | |
) ON [PRIMARY] | |
GO | |
ALTER TABLE [dbo].[pegawai] ADD CONSTRAINT [DF_pegawai_create_at] DEFAULT (getdate()) FOR [create_at] | |
GO | |
ALTER TABLE [dbo].[pegawai] ADD CONSTRAINT [DF_pegawai_update_at] DEFAULT (getdate()) FOR [update_at] | |
GO | |
CREATE TABLE [dbo].[pegawai_log]( | |
[id] [int] IDENTITY(1,1) NOT NULL, | |
[id_pegawai] [int] NOT NULL, | |
[operasi] [varchar](50) NOT NULL, | |
[status] [varchar](10) NOT NULL, | |
[message] [varchar](50) NULL, | |
[create_at] [datetime] NOT NULL, | |
[update_at] [datetime] NOT NULL, | |
CONSTRAINT [PK_pegawai_log] PRIMARY KEY CLUSTERED | |
( | |
[id] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] | |
) ON [PRIMARY] | |
GO | |
ALTER TABLE [dbo].[pegawai_log] ADD CONSTRAINT [DF_pegawai_log_create_at] DEFAULT (getdate()) FOR [create_at] | |
GO | |
ALTER TABLE [dbo].[pegawai_log] ADD CONSTRAINT [DF_pegawai_log_update_at] DEFAULT (getdate()) FOR [update_at] | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment