sql
stringlengths
6
1.05M
-- @testpoint:opengauss关键字uncommitted(非保留),作为表空间名 --关键字不带引号,创建成功 drop tablespace if exists uncommitted; CREATE TABLESPACE uncommitted RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1'; drop tablespace uncommitted; --关键字带双引号,创建成功 drop tablespace if exists "uncommitted"; CREATE TABLESPACE "uncommitted" RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1'; drop tablespace "uncommitted"; --关键字带单引号,合理报错 drop tablespace if exists 'uncommitted'; CREATE TABLESPACE 'uncommitted' RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1'; --关键字带反引号,合理报错 drop tablespace if exists `uncommitted`; CREATE TABLESPACE `uncommitted` RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
-- name: write_specializations_table.sql -- version: 0.0.1 -- date: 20201128 -- author: <NAME> -- desc: Create a list of specializations. .headers on .nullvalue [NULL] DROP TABLE IF EXISTS specializations; CREATE TABLE specializations ( idx INTEGER NOT NULL PRIMARY KEY, specialization INTEGER );
<gh_stars>100-1000 Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... dimension 0: 4->6 (increases) dimension 1: 10->10 (unchanged) Data: (4,0) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, (4,2) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, (4,4) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, (4,6) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, (4,8) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, (5,0) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, (5,2) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, (5,4) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, (5,6) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, (5,8) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}
CREATE TABLE processed_archive_page ( publisher VARCHAR, url VARCHAR PRIMARY KEY ) CREATE TABLE article ( url VARCHAR PRIMARY KEY, publisher VARCHAR, title VARCHAR, published TIMESTAMP WITH TIME ZONE, category VARCHAR, -- publisher specific content VARCHAR, tags VARCHAR[], -- publisher specific about_c_c BOOL ) CREATE TABLE article_sampled ( url VARCHAR PRIMARY KEY, publisher VARCHAR, about_c_c BOOL ) CREATE TABLE temp ( publisher VARCHAR, key VARCHAR, val VARCHAR )
<reponame>devkishor8007/relation_db_nestjs_prisma<filename>prisma/migrations/20220211082908_many2many/migration.sql -- CreateTable CREATE TABLE "Post" ( "id" SERIAL NOT NULL, "title" TEXT NOT NULL, CONSTRAINT "Post_pkey" PRIMARY KEY ("id") ); -- CreateTable CREATE TABLE "Category" ( "id" SERIAL NOT NULL, "name" TEXT NOT NULL, CONSTRAINT "Category_pkey" PRIMARY KEY ("id") ); -- CreateTable CREATE TABLE "CategoriesOnPosts" ( "postId" INTEGER NOT NULL, "categoryId" INTEGER NOT NULL, "assignedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "assignedBy" TEXT NOT NULL, CONSTRAINT "CategoriesOnPosts_pkey" PRIMARY KEY ("postId","categoryId") ); -- AddForeignKey ALTER TABLE "CategoriesOnPosts" ADD CONSTRAINT "CategoriesOnPosts_postId_fkey" FOREIGN KEY ("postId") REFERENCES "Post"("id") ON DELETE RESTRICT ON UPDATE CASCADE; -- AddForeignKey ALTER TABLE "CategoriesOnPosts" ADD CONSTRAINT "CategoriesOnPosts_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "Category"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 1192.168.3.11 -- Generation Time: Jul 25, 2020 at 10:54 AM -- Server version: 10.4.13-MariaDB -- PHP Version: 7.4.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; 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 utf8mb4 */; -- -- Database: `db_bimawa` -- -- -------------------------------------------------------- -- -- Table structure for table `tbl_agenda` -- CREATE TABLE `tbl_agenda` ( `agenda_id` int(11) NOT NULL, `agenda_nama` varchar(200) DEFAULT NULL, `agenda_tanggal` timestamp NULL DEFAULT current_timestamp(), `agenda_deskripsi` text DEFAULT NULL, `agenda_mulai` date DEFAULT NULL, `agenda_selesai` date DEFAULT NULL, `agenda_tempat` varchar(90) DEFAULT NULL, `agenda_waktu` varchar(30) DEFAULT NULL, `agenda_keterangan` varchar(200) DEFAULT NULL, `agenda_author` varchar(60) DEFAULT NULL, `agenda_gambar` varchar(40) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_agenda` -- INSERT INTO `tbl_agenda` (`agenda_id`, `agenda_nama`, `agenda_tanggal`, `agenda_deskripsi`, `agenda_mulai`, `agenda_selesai`, `agenda_tempat`, `agenda_waktu`, `agenda_keterangan`, `agenda_author`, `agenda_gambar`) VALUES (9, 'Wisuda', '2020-07-25 08:20:40', 'wisuda periode 3', '2020-07-07', '2020-07-30', 'JEC', '10:30', 'wisuda akbar', 'agung', 'a9338dd6f403bcb8068b26d08ac47730.jpg'), (10, 'Seminar', '2020-07-25 08:21:38', 'ajsnjansasqddwdb', '2020-06-30', '2020-07-30', 'Hotel JEC', '09:00-12:00', 'Wajib', 'agung', '5951346a79720abf16a6ca51e063391e.jpg'), (11, '<NAME>', '2020-07-25 08:22:53', 'namanya juga usaha ya harus semangat', '2020-07-09', '2020-07-24', 'Hongkong', '06:00-11:00', 'kasjajsnajd', 'agung', 'de0772a6ba546bfbba7331c4c2ad78e2.jpeg'), (12, '<NAME>', '2020-07-25 08:23:33', 'dddwdwdw', '2020-08-11', '2020-07-17', 'Musholla', '09:00', 'sadsd', 'agung', '4a5e7e32a6d16518498ec4bc6bfdcbd0.jpg'), (13, '<NAME>', '2020-07-25 08:24:12', 'wud9 qdeufcuoeqb', '2020-07-19', '2020-07-28', 'Medan', '07:00', 'asadadasdad', 'agung', '0a85c91cbafbaf23c06652ecb681c70c.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_files` -- CREATE TABLE `tbl_files` ( `file_id` int(11) NOT NULL, `file_judul` varchar(120) DEFAULT NULL, `file_deskripsi` text DEFAULT NULL, `file_tanggal` timestamp NULL DEFAULT current_timestamp(), `file_oleh` varchar(60) DEFAULT NULL, `file_download` int(11) DEFAULT 0, `file_data` varchar(120) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_files` -- INSERT INTO `tbl_files` (`file_id`, `file_judul`, `file_deskripsi`, `file_tanggal`, `file_oleh`, `file_download`, `file_data`) VALUES (13, 'Pedoman-Mawapres-Sarjana-2016', 'Pedoman-Mawapres-Sarjana-2016', '2020-02-27 13:54:40', 'Suhendra', 0, 'e45dc33d9848a2d1b7da0b986223a762.pdf'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_galeri` -- CREATE TABLE `tbl_galeri` ( `galeri_id` int(11) NOT NULL, `galeri_judul` varchar(60) DEFAULT NULL, `galeri_tanggal` timestamp NULL DEFAULT current_timestamp(), `galeri_gambar` varchar(40) DEFAULT NULL, `galeri_album_id` int(11) DEFAULT NULL, `galeri_pengguna_id` int(11) DEFAULT NULL, `galeri_author` varchar(60) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_galeri` -- INSERT INTO `tbl_galeri` (`galeri_id`, `galeri_judul`, `galeri_tanggal`, `galeri_gambar`, `galeri_album_id`, `galeri_pengguna_id`, `galeri_author`) VALUES (4, 'Diskusi Pemilihan Ketua Osis', '2017-01-21 14:04:53', '9b10fa300633f62f105e9b52789fc8f3.jpg', 3, 1, 'M Fikri Setiadi'), (5, 'Panitia Pemilu Osis', '2017-01-22 04:13:20', '0ec0c2f9aae6501d7ed7930995d48b57.jpg', 3, 1, 'M Fikri Setiadi'), (6, 'Proses Pemilu Osis', '2017-01-22 04:13:43', 'bfbe6cc1c8096f5f36c68e93da53c248.jpg', 3, 1, 'M Fikri Setiadi'), (7, 'Belajar dengan native speaker', '2017-01-24 01:26:22', '831e5ad43ccc3c851d50c128ff095541.jpg', 1, 1, 'M Fikri Setiadi'), (8, 'Diskusi dengan native speaker', '2017-01-24 01:27:05', '84afbf1d3ad45932f1d7ac47b8a00949.jpg', 1, 1, 'M Fikri Setiadi'), (9, 'Foto bareng native speaker', '2017-01-24 01:27:28', 'a99ab060d5d5bf8c96f24fe385f7dd8b.jpg', 1, 1, 'M Fikri Setiadi'), (10, 'Foto bareng native speaker', '2017-01-24 01:28:40', 'd70cedba6391b7b3c74b914efd82953f.jpg', 1, 1, 'M Fikri Setiadi'), (11, 'Foto bareng native speaker', '2017-01-24 01:28:54', '10de99f425b9961ce1e87c5e5575f8f4.jpg', 1, 1, 'M Fikri Setiadi'), (12, 'Belajar sambil bermain', '2017-01-24 01:31:42', '9df82241493b94d1e06b461129cf57b2.jpg', 4, 1, 'M Fikri Setiadi'), (13, 'Belajar sambil bermain', '2017-01-24 01:31:55', '5374415f11683ad6dd31572a7bbf8a7b.jpg', 4, 1, 'M Fikri Setiadi'), (14, 'Belajar komputer programming', '2017-01-24 01:32:24', '82b91bd35706b21c3ab04e205e358eb6.jpg', 4, 1, 'M Fikri Setiadi'), (15, 'Belajar komputer programming', '2017-01-24 01:32:34', '93048f2a103987bce8c8ec8d6912de06.jpg', 4, 1, 'M Fikri Setiadi'), (16, 'Belajar komputer programming', '2017-01-24 01:32:44', '41f46be181f2f8452c2041b5e79a05a5.jpg', 4, 1, 'M Fikri Setiadi'), (17, 'Belajar sambil bermain', '2017-01-24 01:33:08', '2858b0555c252690e293d29b922ba8e6.jpg', 4, 1, 'M Fikri Setiadi'), (18, 'Makan bersama', '2017-01-24 01:33:24', '90d67328e33a31d3f5eecd7dcb25b55d.jpg', 4, 1, 'M Fikri Setiadi'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_inbox` -- CREATE TABLE `tbl_inbox` ( `inbox_id` int(11) NOT NULL, `inbox_nama` varchar(40) DEFAULT NULL, `inbox_email` varchar(60) DEFAULT NULL, `inbox_kontak` varchar(20) DEFAULT NULL, `inbox_pesan` text DEFAULT NULL, `inbox_tanggal` timestamp NULL DEFAULT current_timestamp(), `inbox_status` int(11) DEFAULT 1 COMMENT '1=Belum dilihat, 0=Telah dilihat' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_inbox` -- INSERT INTO `tbl_inbox` (`inbox_id`, `inbox_nama`, `inbox_email`, `inbox_kontak`, `inbox_pesan`, `inbox_tanggal`, `inbox_status`) VALUES (9, 'Azmi', '<EMAIL>', '089212123893', 'Keren Sekali admin satu ini', '2020-03-02 02:47:32', 0); -- -------------------------------------------------------- -- -- Table structure for table `tbl_kategori` -- CREATE TABLE `tbl_kategori` ( `kategori_id` int(11) NOT NULL, `kategori_nama` varchar(30) DEFAULT NULL, `kategori_tanggal` timestamp NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_kategori` -- INSERT INTO `tbl_kategori` (`kategori_id`, `kategori_nama`, `kategori_tanggal`) VALUES (1, 'Pendidikan', '2016-09-06 05:49:04'), (5, 'KP', '2016-09-06 06:19:26'), (6, 'Prestasi', '2016-09-07 02:51:09'), (13, '<NAME>', '2017-01-13 13:20:31'), (14, 'Bidikmisi', '2020-03-05 06:35:52'), (16, 'SSO', '2020-03-05 09:20:06'), (17, 'PPA', '2020-03-05 09:20:19'), (18, 'SEM2', '2020-03-05 09:20:34'), (20, 'BSM', '2020-03-05 09:22:42'), (21, 'PKM', '2020-03-05 10:40:40'), (22, 'Kompetisi', '2020-03-05 10:41:09'), (23, 'SKPI', '2020-03-05 10:41:45'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_komentar` -- CREATE TABLE `tbl_komentar` ( `komentar_id` int(11) NOT NULL, `komentar_nama` varchar(30) DEFAULT NULL, `komentar_email` varchar(50) DEFAULT NULL, `komentar_isi` varchar(120) DEFAULT NULL, `komentar_tanggal` timestamp NULL DEFAULT current_timestamp(), `komentar_status` varchar(2) DEFAULT NULL, `komentar_tulisan_id` int(11) DEFAULT NULL, `komentar_parent` int(11) DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_komentar` -- INSERT INTO `tbl_komentar` (`komentar_id`, `komentar_nama`, `komentar_email`, `komentar_isi`, `komentar_tanggal`, `komentar_status`, `komentar_tulisan_id`, `komentar_parent`) VALUES (1, '<NAME>', '<EMAIL>', ' Nice Post.', '2018-08-07 15:09:07', '1', 24, 0), (2, '<NAME>', '<EMAIL>', ' Awesome Post', '2018-08-07 15:14:26', '1', 24, 0), (3, 'Joko', '<EMAIL>', 'Thank you.', '2018-08-08 03:54:56', '1', 24, 1), (6, 'oke', '<EMAIL>', 'keren min<br />\r\n ', '2020-03-09 07:23:33', '1', 27, 0); -- -------------------------------------------------------- -- -- Table structure for table `tbl_log_aktivitas` -- CREATE TABLE `tbl_log_aktivitas` ( `log_id` int(11) NOT NULL, `log_nama` text DEFAULT NULL, `log_tanggal` timestamp NULL DEFAULT current_timestamp(), `log_ip` varchar(20) DEFAULT NULL, `log_pengguna_id` int(11) DEFAULT NULL, `log_icon` blob DEFAULT NULL, `log_jenis_icon` varchar(50) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tbl_pengguna` -- CREATE TABLE `tbl_pengguna` ( `pengguna_id` int(11) NOT NULL, `pengguna_nama` varchar(50) DEFAULT NULL, `pengguna_jenkel` varchar(2) DEFAULT NULL, `pengguna_username` varchar(30) DEFAULT NULL, `pengguna_password` varchar(35) DEFAULT NULL, `pengguna_email` varchar(50) DEFAULT NULL, `pengguna_nohp` varchar(20) DEFAULT NULL, `pengguna_status` int(2) DEFAULT 1, `pengguna_level` varchar(3) DEFAULT NULL, `pengguna_register` timestamp NULL DEFAULT current_timestamp(), `pengguna_photo` varchar(40) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_pengguna` -- INSERT INTO `tbl_pengguna` (`pengguna_id`, `pengguna_nama`, `pengguna_jenkel`, `pengguna_username`, `pengguna_password`, `pengguna_email`, `pengguna_nohp`, `pengguna_status`, `pengguna_level`, `pengguna_register`, `pengguna_photo`) VALUES (5, 'ilham', 'L', 'ilham', '<PASSWORD>1970e7c044a', '<EMAIL>', '121212212', 1, '1', '2020-02-05 02:10:11', 'd19f3439ec9f8f55a44cefa8db5a8ac1.jpg'), (7, 'agung', 'L', 'agung', 'd1568ac35ca5f47bfb6381970e7c044a', '<EMAIL>', '0890998273', 1, '2', '2020-03-06 09:25:56', 'd54d19a23079da857d78514925a57654.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_pengumuman` -- CREATE TABLE `tbl_pengumuman` ( `pengumuman_id` int(11) NOT NULL, `pengumuman_judul` varchar(150) DEFAULT NULL, `pengumuman_deskripsi` text DEFAULT NULL, `pengumuman_tanggal` timestamp NULL DEFAULT current_timestamp(), `pengumuman_author` varchar(60) DEFAULT NULL, `pengumuman_gambar` varchar(60) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_pengumuman` -- INSERT INTO `tbl_pengumuman` (`pengumuman_id`, `pengumuman_judul`, `pengumuman_deskripsi`, `pengumuman_tanggal`, `pengumuman_author`, `pengumuman_gambar`) VALUES (10, 'Pencegahan Virus Corona', 'Dihimbau kepada seluruh civitas akademika UAD untuk selalu menjaga kebersihan dengan selalu mencuci tangan dengan sabun sebelum makan, serta menggunakan masker ketika beraktifitas di luar ruangan', '2020-07-25 08:25:07', 'agung', '1321d4f7845bc80be77d590da13a26fc.jpg'), (11, 'Libur Akhir Tahun', 'Setelah libur semester ganjil tahun ajaran 2019-2020, proses Perkuliahan di semester genap tahun ajaran 2019-2020 mulai aktif kembali tanggal 2 Maret 2020', '2020-07-25 08:25:42', 'agung', '15fae80841d2050c1c55a68f9dbbfc89.JPG'), (12, 'UAS GASAL', 'Libur semester ganjil tahun ajaran 2016-2017 dimulai dari tanggal 3 Maret 2017 sampai dengan tanggal 7 Maret 207.', '2020-07-25 08:26:26', 'agung', '83eba85a8613dc5a21a00322bf5b095e.JPG'), (13, 'UTS SEMESTER GENAP 2020', 'Berhasil untuk Jujur', '2020-07-25 08:26:47', 'agung', '74c118d5a438e94094e38057cebdd19c.JPG'), (14, '<NAME>', 'dnond ednje nqwndnuf udbfi dsbfsnfj;khasbdfbwf', '2020-07-25 08:27:14', 'agung', '356ea3ae6c5bf53f234c04419ca6041f.JPG'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_pengunjung` -- CREATE TABLE `tbl_pengunjung` ( `pengunjung_id` int(11) NOT NULL, `pengunjung_tanggal` timestamp NULL DEFAULT current_timestamp(), `pengunjung_ip` varchar(40) DEFAULT NULL, `pengunjung_perangkat` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_pengunjung` -- INSERT INTO `tbl_pengunjung` (`pengunjung_id`, `pengunjung_tanggal`, `pengunjung_ip`, `pengunjung_perangkat`) VALUES (930, '2018-08-09 08:04:59', '::1', 'Chrome'), (931, '2020-02-05 13:58:48', '::1', 'Firefox'), (932, '2020-02-06 09:14:11', '::1', 'Firefox'), (933, '2020-02-07 02:25:11', '::1', 'Firefox'), (934, '2020-02-08 03:11:34', '::1', 'Firefox'), (935, '2020-02-10 02:32:47', '::1', 'Firefox'), (936, '2020-02-11 02:42:53', '127.0.0.1', 'Firefox'), (937, '2020-02-11 09:34:14', '::1', 'Firefox'), (938, '2020-02-12 06:27:11', '::1', 'Firefox'), (939, '2020-02-14 09:04:34', '::1', 'Firefox'), (940, '2020-02-15 11:52:29', '::1', 'Chrome'), (941, '2020-02-24 08:31:50', '::1', 'Firefox'), (942, '2020-02-26 12:43:25', '::1', 'Chrome'), (943, '2020-02-27 06:54:14', '::1', 'Chrome'), (944, '2020-02-28 01:08:05', '::1', 'Chrome'), (945, '2020-02-29 01:30:09', '::1', 'Chrome'), (946, '2020-03-02 01:51:31', '::1', 'Chrome'), (947, '2020-03-03 04:19:11', '::1', 'Chrome'), (948, '2020-03-04 03:10:50', '::1', 'Chrome'), (949, '2020-03-05 02:57:39', '::1', 'Chrome'), (950, '2020-03-06 07:15:33', '::1', 'Chrome'), (951, '2020-03-08 12:59:24', '::1', 'Chrome'), (952, '2020-03-09 05:42:24', '::1', 'Chrome'), (953, '2020-03-10 15:22:37', '::1', 'Chrome'), (954, '2020-03-11 01:10:14', '::1', 'Chrome'), (955, '2020-03-13 14:45:21', '::1', 'Chrome'), (956, '2020-03-15 11:33:15', '::1', 'Chrome'), (957, '2020-03-16 03:27:13', '::1', 'Chrome'), (958, '2020-04-14 15:41:42', '::1', 'Firefox'), (959, '2020-07-24 00:30:20', '::1', 'Firefox'), (960, '2020-07-24 00:44:15', '127.0.0.1', 'Firefox'), (961, '2020-07-25 06:22:19', '::1', 'Chrome'), (962, '2020-07-25 06:38:41', '127.0.0.1', 'Firefox'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_testimoni` -- CREATE TABLE `tbl_testimoni` ( `testimoni_id` int(11) NOT NULL, `testimoni_nama` varchar(30) DEFAULT NULL, `testimoni_isi` varchar(120) DEFAULT NULL, `testimoni_email` varchar(35) DEFAULT NULL, `testimoni_tanggal` timestamp NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tbl_tulisan` -- CREATE TABLE `tbl_tulisan` ( `tulisan_id` int(11) NOT NULL, `tulisan_judul` varchar(100) DEFAULT NULL, `tulisan_isi` text DEFAULT NULL, `tulisan_tanggal` timestamp NULL DEFAULT current_timestamp(), `tulisan_kategori_id` int(11) DEFAULT NULL, `tulisan_kategori_nama` varchar(30) DEFAULT NULL, `tulisan_views` int(11) DEFAULT 0, `tulisan_gambar` varchar(40) DEFAULT NULL, `tulisan_pengguna_id` int(11) DEFAULT NULL, `tulisan_author` varchar(40) DEFAULT NULL, `tulisan_img_slider` int(2) NOT NULL DEFAULT 0, `tulisan_slug` varchar(200) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_tulisan` -- INSERT INTO `tbl_tulisan` (`tulisan_id`, `tulisan_judul`, `tulisan_isi`, `tulisan_tanggal`, `tulisan_kategori_id`, `tulisan_kategori_nama`, `tulisan_views`, `tulisan_gambar`, `tulisan_pengguna_id`, `tulisan_author`, `tulisan_img_slider`, `tulisan_slug`) VALUES (25, 'iPhone 8 Baru Mengungkapkan Fitur Mengecewakan', '<p>Apple CEO <NAME> delivers the opening keynote address the 2017 Apple.</p>\r\n\r\n<p><br />\r\nSudah lama sekali sejak Apple mampu menyimpan kejutan nyata dari beledu digital dan mengungkapkan &#39;satu hal&#39; yang sebenarnya selama sebuah keynote. Fase desain dan prototyping yang panjang, ditambah dengan rantai pasokan yang diperluas, telah menghasilkan garis manufaktur yang bocor.<br />\r\n<br />\r\nTariklah permintaan yang tak terpuaskan dari si geekerati dan Anda tidak akan pernah bisa menyimpan rahasianya ... bahkan jika penonton akan berpura-pura bahwa segala sesuatu yang dikatakan Tim Cook adalah sebuah wahyu.<br />\r\n<br />\r\nSemuanya di tampilkan untuk portofolio iPhone baru, meskipun jika kita jujur ??tidak ada hal baru yang bisa dilihat. Ini hanya <NAME> dan timnya yang membuat model tahun lalu &#39;sedikit lebih baik&#39; dan mengajukan konsumen proposisi yang sama seperti setiap produsen smartphone lainnya.<br />\r\n<br />\r\nMungkin aku berharap terlalu banyak dari Apple. Pengulangan Timey dari mimpi Silicon Valley tidak dibangun dengan risiko, mendorong amplop, atau bereksperimen dengan bentuk atau fungsinya. Bagaimana Tim Cook bisa mendorong inovasi ketika begitu banyak kekaisarannya dibangun di seputar kebutuhan akan penjualan siklis iPhone yang terjamin? Jika penjualan smartphone turun, maka yayasan Cupertino akan berada dalam bahaya.<br />\r\n<br />\r\nJawaban Apple untuk ini adalah iPhone 8. Sementara iPhone 7S dan iPhone 7S Plus menjaga harapan, iPhone 8 bisa bereksperimen dengan bentuk, harga, dan kekuatan. Ini adalah handset yang akan mendorong batas teknologi Apple dengan layar OLED yang cerah dan jelas di bawah kaca melengkung yang membentuk bagian luarnya. Inilah smartphone yang membawa kekuatan magis wireless charging ke ekosistem iOS dan akan menawarkan pengenalan wajah untuk keamanan.<br />\r\n<br />\r\nYang semua terdengar hebat tapi itu satu set poin peluru yang bisa diterapkan ke banyak handset Android terkemuka yang ada di pasaran saat ini. Bahkan dengan andalannya yang maju untuk tahun 2017, Apple melakukan sedikit lebih banyak daripada mengenalkan teknologi yang ada ke portofolio iOS.<br />\r\n<br />\r\nItu tidak terlihat seperti ini beberapa bulan yang lalu. Fitur yang diduga dikeluarkan oleh Apple dari iPhone 8 memamerkan beberapa pemikiran terbaru tentang perangkat mobile, termasuk pengisian daya nirkabel jarak jauh dan sensor biometrik tertanam di bawah layar kaca. Ini perlahan-lahan telah terbantahkan oleh industri rumahan dan desas-desus, sampai-sampai kita cukup tahu apa yang terjadi dari iPhone 8.<br />\r\n<br />\r\nTentu saja iPhone 8 (dan lebih dari kemungkinan iPhone 7S dan 7S Plus) akan mendapat keuntungan dari perubahan pada konstruksi interior. Akan ada pencantuman iOS 11 dan integrasi perangkat lunak yang ketat ke perangkat keras. Akan ada anggukan Apple untuk kesederhanaan di UI dan aplikasi pihak ketiga akan segera menghadirkan fitur lanjutan kepada pengguna rata-rata.<br />\r\n<br />\r\nIni bukan perubahan sepele, tapi yang menyoroti ini adalah menjelaskan bagaimana sosis dibuat. Mereka adalah rakit tweak untuk paket yang sama. Anda bisa menambahkan kancing diamante ke gaun Anda, mengganti lapisannya, dan mengeluarkan pinggulnya karena tahun-tahun yang lewat, tapi pakaiannya tetap sama seperti yang orang lihat berkali-kali. Itu cukup bagi bisnis Apple untuk terus melakukannya dengan baik dan membuat pemegang saham tetap bahagia, namun Anda tidak dapat terus kembali ke bidang yang sama dan berharap untuk tetap berada di puncak permainan smartphone. Sesuatu harus diberikan.<br />\r\n<br />\r\nPortofolio Apple 2017 membajak bidang yang sama persis dengan tahun-tahun sebelumnya. Tulang punggung penjualan akan terdiri dari iPhone 7S dan iPhone 7S Plus yang berulang-ulang saat Tim Cook kembali menanam benih di alur yang sama persis seperti model sebelumnya. IPhone 8 dapat diluncurkan tepat waktu, namun stok akan sulit didapat dan Apple akan, sekali lagi, tidak merilis angka penjualan. Ini akan menjadi hal baru yang menarik dan berkilau, tapi mari kita panggil apa adanya.</p>\r\n\r\n<p>Tim Cook akan menyilangkan jari-jarinya sehingga cukup banyak orang yang senang bisa &#39;membeli iPhone lain&#39; dan terus menggelontorkannya tanpa melihat persaingan. IPhone 8 adalah Apple yang bermain mengejar kemajuan teknologi kompetisi, dengan harapan tidak ada yang memperhatikan bahwa iPhone Baru Kaisar tidak semudah yang terlihat.</p>\r\n', '2018-08-08 13:26:08', 5, 'Penelitian', 20, '6a970a1294eb9eeb540279e3803d5f83.jpg', 5, 'ilham', 0, 'iphone-8-baru-mengungkapkan-fitur-mengecewakan'), (26, 'UKM SEPAKBOLA JUARA PIALA GUBERNUR DIY', '<p>UKM SEPAKBOLA JUARA PIALA GUBERNUR DIY</p>\r\n', '2020-02-26 12:57:57', 6, 'Prestasi', 18, '79c9ac2775a302ca4308592cad68f01f.jpg', 5, 'ilham', 0, 'ukm-sepakbola-juara-piala-gubernur-diy'), (27, 'Penerima Beasiswa BPM-KP 2019', '<p>Universitas Ahmad Dahlan (UAD) mengirimkan 3 delegasi ke World Universities Debating Championship (WUDC) atau Kompetisi Debat Bahasa Inggris tingkat dunia di Bangkok Thailand sejak 17 Desember 2019 hingga 4 Januari 2020.</p>\r\n\r\n<p>Ketiga delegasi itu, <NAME> (Pendidikan Bahasa Inggris), <NAME> (Sastra Inggris) dan <NAME> (Sastra Inggris). &ldquo;Kedua orang, Annisa dan Ika sebagai tim debat, 1 orang yakni Rifki sebagai adjudicator atau dewan juri,&rdquo; ujar Ika Suciwati mengabarkan dari Bangkok, Kamis (2/1/2020).</p>\r\n\r\n<p>Disebutkan Ika Suciwati, setelah melewati 9 babak penyisihan atau prelimibary rounds, meski tidak lolos untuk babak semifinal, Tim Debating UAD meraih total 9 poin kemenangan, merupakan poin yang cukup tinggi dengan penuh kerja keras yang maksimal.</p>\r\n\r\n<p>Sedangkan Rifki, berhasil menjadi dewan juri ahli atau disebut panelist selama 9 rounds penuh tanpa pernah diturunkan ke level terbawah yakni trainee. Tim Debating didampingi Nur Rufa&rsquo;i Akhsan MEd,&nbsp; dosen UAD sebagai observer dari Kemenristek Dikti.</p>\r\n\r\n<p>Ditambahkan <NAME>, ada 20 tim debating dari Indonesia yang mengikuti ajang WUDC tahun ini. &ldquo;Selama 5 hari ini memang tidak dianjurkan untuk menggunakan atribut universitas dalam bentuk apapun untuk menghindari keberpihakan ke institusi tertentu,&rdquo; ujarnya.</p>\r\n\r\n<p>Sedangkan Danang Sukantar MPd, Kabid Pengembangan Mahasiswa Biro Kemahasiswaan dan Alumni (Bimawa) UAD yang mengirimkan delegasi tersebut berkomentar, Debater UAD ini memang membanggakan. &ldquo;Tim ini, membanggakan, selalu bersemangat dan fokus setiap moment baik di tingkat nasional maupun internasional,&rdquo; ujarnya.</p>\r\n', '2020-03-02 04:07:31', 5, 'KP', 25, '05ff7d2398439dab7080293728492033.jpg', 5, 'ilham', 0, 'penerima-beasiswa-bpm-kp--2019'), (28, 'Tunavoice alat bantu penyandang tunawicara ', '<p>Tunavoice alat bantu penyandang&nbsp;tunawicara&nbsp;hasil rancangan mahasiswa Universitas Ahmad Dahlan (UAD) Yogyakarta memenangkan medali emas dan perak dalam ajang internasional inovasi teknologi di&nbsp;Bangkok, Ahad-Kamis (2-6/2/2020).</p>\r\n\r\n<p>Tim mahasiswa&nbsp;UADperancang Tunavoice ini terdiri Ilham Ak<NAME>, M Fahrurazi IB, Renangga Yudianto, dan Sariningsih. Tim ini dibimbing dosen Dr <NAME>udhana.</p>\r\n\r\n<p>Temuan mereka yang sangat membantu penyandang&nbsp;tunawicaraini menang untuk kategori kreativitas dan inovasi.</p>\r\n\r\n<p>Lomba ini diadakan Badan Riset Nasional Thailand. Nama acaranya Thailand Inventors Day-Bangkok International Intellectual Property, Invention, Innovation and Technology Expotition (IPITEx) 2020.</p>\r\n\r\n<p>Acara ini diikuti oleh 45 negara dengan jumlah peserta mencapai 1.500 orang. Ribuan inovasi teknologi dipamerkan dalam arena ini termasuk buatan empat mahasiswa dari Yogya.</p>\r\n\r\n<p>Alat Bantu Bicara</p>\r\n\r\n<p>Dosen pembimbing Anton Yudhana menjelaskan, Tunavoice adalah alat untuk mendeteksi gerakan jari tangan yang kemudian diolah datanya di arduino dalam bentuk sebuah huruf atau kata.</p>\r\n\r\n<p>&ldquo;Lalu hasil olahan datanya dikirim melalui Bluetooth. Olahan data ini muncul pada display layar smartphone berupa teks dan suara yang dapat membantu tunawicara dalam berkomunikasi,&rdquo; terang Anton Yudhana.</p>\r\n\r\n<p>Menurut Anton Yudhana, IPITEx 2020 merupakan acara tahunan yang masuk dalam agenda World Invention Intellectual Property Association (WIIPA).</p>\r\n\r\n<p>Sementara Danang Sukantar, MPd, kepala Bidang Pengembangan Kemahasiswaan Biro Kemahasiswaan dan Alumni (Bimawa) UAD, menambahkan, kegiatan tahunan yang diselenggarakan oleh Badan Riset Nasional Thailand &nbsp;sebagai puncak acara peringatan Hari Inovasi Nasional Thailand yang diperingati setiap tanggal 2 Februari.</p>\r\n\r\n<p>&ldquo;IPITex merupakan suatu ajang perlombaan di bidang inovasi terbesar di Asia yang diikuti oleh para inovator dari berbagai negara di dunia,&rdquo; kata Danang Sukantar di ruang kerjanya, Sabtu (8/2/2020).</p>\r\n\r\n<p>Danang merasa bangga karena Tim UAD Yogyakarta berhasil dalam satu event, dua competition, dua medal gold dan silver. Dalam kegiatan itu lebih dari seribu penemuan dan lebih dari 20 ribu orang berkunjung dalam acara ini dan 1.500 delegasi dari 45 negara.</p>\r\n\r\n<p>Sumber : https://pwmu.co/131144/02/10/tunavoice-buatan-mahasiswa-uad-raih-emas-di-bangkok/</p>\r\n', '2020-03-02 04:11:34', 6, 'Prestasi', 13, '862b1a89a9089cf8f8327bd9ead5a173.jpg', 5, 'ilham', 0, 'tunavoice-alat-bantu-penyandang-tunawicara'), (31, 'Beasiswa DIKPORA Tahun 2019', '<p>Bantuan Biaya Pendidikan Bagi Mahasiswa Reguler</p>\r\n\r\n<p>Dinas Pendidikan, Pemuda dan Olahraga</p>\r\n\r\n<p>Daerah Istimewa Yogyakarta</p>\r\n\r\n<p>Tahun 2019</p>\r\n\r\n<p>Dinas Pendidikan, Pemuda dan Olahraga Daerah Istimewa Yogyakarta memberikan bantuan biaya pendidikan&nbsp; bagi mahasiswa reguler. informasi mengenai hal tersebut silakan diunduh dibawah ini:&nbsp;<a href=\"http://bimawa.uad.ac.id/wp-content/uploads/2019/02/Informasi-Beasiswa-DIKPORA.pdf\">Panduan Bantuan Beasiswa DIKPORA</a>]]&gt;</p>\r\n\r\n<h3>AGENDA KEGIATAN</h3>\r\n', '2020-03-05 15:12:43', 16, 'SSO', 5, '3427de944e6732124e25f3e3a676ee97.jpg', 5, 'ilham', 0, 'beasiswa-dikpora-tahun-2019'), (32, 'Undangan Mahasiswa Beasiswa', '<p>16 Agustus 2018</p>\r\n\r\n<p>Nomor :&nbsp; R.III/73/D.66/VIII/2018 Lamp.&nbsp; :&nbsp; &ndash; Hal&nbsp; &nbsp; &nbsp; &nbsp;:&nbsp; Undangan &nbsp; Kepada Yth. 1. Para Wakil Dekan</p>\r\n\r\n<ol>\r\n <li>Para Kaprodi</li>\r\n</ol>\r\n\r\n<p>di Tempat Assalamu&rsquo;alaikum warahmatullahi wabarakatuh. Kami mengharap kehadiran Saudara pada acara Orientasi, Penandatanganan Kontrak, Calon Mahasiswa Baru Beasiswa Program Misi Keluarga Persyarikatan (BPM-KP), Sains, Seni, dan Olahraga (BPM-SSO) dan BidikMisi pada: Hari&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : Senin Tanggal&nbsp; &nbsp; &nbsp; &nbsp; : 20 Agustus 2018 Waktu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : 09.00 &ndash; 12.00 WIB Tempat&nbsp; &nbsp; &nbsp; &nbsp; : Auditorium Kampus 1 UAD Rapat akan dimulai tepat pada waktunya, dan bagi yang berhalangan hadir harap memberitahu sebelumnya. Terima kasih atas perhatian dan kerjasamanya. Wassalamu&rsquo;alaikum warahmatullahi wabarakatuh.&nbsp;<em>&nbsp;</em>&nbsp;a.n. Rektor, Wakil Rektor III &nbsp; Dr. <NAME>, M.T. NIY. 60960140&nbsp;<strong>Undangan silahkan klik</strong>&nbsp;<a href=\"http://bimawa.uad.ac.id/wp-content/uploads/2018/08/disini.pdf\">disini</a>]]&gt;</p>\r\n', '2020-03-05 15:29:57', 21, 'PKM', 5, '429106d72badbfd44d98d5a54cc594ae.jpg', 5, 'ilham', 0, 'undangan-mahasiswa-beasiswa'); -- -- Indexes for dumped tables -- -- -- Indexes for table `tbl_agenda` -- ALTER TABLE `tbl_agenda` ADD PRIMARY KEY (`agenda_id`); -- -- Indexes for table `tbl_files` -- ALTER TABLE `tbl_files` ADD PRIMARY KEY (`file_id`); -- -- Indexes for table `tbl_galeri` -- ALTER TABLE `tbl_galeri` ADD PRIMARY KEY (`galeri_id`), ADD KEY `galeri_album_id` (`galeri_album_id`), ADD KEY `galeri_pengguna_id` (`galeri_pengguna_id`); -- -- Indexes for table `tbl_inbox` -- ALTER TABLE `tbl_inbox` ADD PRIMARY KEY (`inbox_id`); -- -- Indexes for table `tbl_kategori` -- ALTER TABLE `tbl_kategori` ADD PRIMARY KEY (`kategori_id`); -- -- Indexes for table `tbl_komentar` -- ALTER TABLE `tbl_komentar` ADD PRIMARY KEY (`komentar_id`), ADD KEY `komentar_tulisan_id` (`komentar_tulisan_id`); -- -- Indexes for table `tbl_log_aktivitas` -- ALTER TABLE `tbl_log_aktivitas` ADD PRIMARY KEY (`log_id`), ADD KEY `log_pengguna_id` (`log_pengguna_id`); -- -- Indexes for table `tbl_pengguna` -- ALTER TABLE `tbl_pengguna` ADD PRIMARY KEY (`pengguna_id`); -- -- Indexes for table `tbl_pengumuman` -- ALTER TABLE `tbl_pengumuman` ADD PRIMARY KEY (`pengumuman_id`); -- -- Indexes for table `tbl_pengunjung` -- ALTER TABLE `tbl_pengunjung` ADD PRIMARY KEY (`pengunjung_id`); -- -- Indexes for table `tbl_testimoni` -- ALTER TABLE `tbl_testimoni` ADD PRIMARY KEY (`testimoni_id`); -- -- Indexes for table `tbl_tulisan` -- ALTER TABLE `tbl_tulisan` ADD PRIMARY KEY (`tulisan_id`), ADD KEY `tulisan_kategori_id` (`tulisan_kategori_id`), ADD KEY `tulisan_pengguna_id` (`tulisan_pengguna_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tbl_agenda` -- ALTER TABLE `tbl_agenda` MODIFY `agenda_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `tbl_files` -- ALTER TABLE `tbl_files` MODIFY `file_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `tbl_galeri` -- ALTER TABLE `tbl_galeri` MODIFY `galeri_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; -- -- AUTO_INCREMENT for table `tbl_inbox` -- ALTER TABLE `tbl_inbox` MODIFY `inbox_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `tbl_kategori` -- ALTER TABLE `tbl_kategori` MODIFY `kategori_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT for table `tbl_komentar` -- ALTER TABLE `tbl_komentar` MODIFY `komentar_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `tbl_log_aktivitas` -- ALTER TABLE `tbl_log_aktivitas` MODIFY `log_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tbl_pengguna` -- ALTER TABLE `tbl_pengguna` MODIFY `pengguna_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `tbl_pengumuman` -- ALTER TABLE `tbl_pengumuman` MODIFY `pengumuman_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `tbl_pengunjung` -- ALTER TABLE `tbl_pengunjung` MODIFY `pengunjung_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=963; -- -- AUTO_INCREMENT for table `tbl_testimoni` -- ALTER TABLE `tbl_testimoni` MODIFY `testimoni_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tbl_tulisan` -- ALTER TABLE `tbl_tulisan` MODIFY `tulisan_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33; COMMIT; /*!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 */;
-- phpMyAdmin SQL Dump -- version 5.0.3 -- https://www.phpmyadmin.net/ -- -- Počítač: 127.0.0.1 -- Vytvořeno: Čtv 11. bře 2021, 22:17 -- Verze serveru: 10.4.14-MariaDB -- Verze PHP: 7.4.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; 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 utf8mb4 */; -- -- Databáze: `computers` -- -- -------------------------------------------------------- -- -- Struktura tabulky `computer` -- CREATE TABLE `computer` ( `Id` int(255) NOT NULL, `Ip` int(255) NOT NULL, `MacAddress` varchar(255) NOT NULL, `ComputerName` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Vypisuji data pro tabulku `computer` -- INSERT INTO `computer` (`Id`, `Ip`, `MacAddress`, `ComputerName`) VALUES (1, 197, '15', 'Andy'), (3, 56, '74Ahoj', 'kokot'); -- -- Klíče pro exportované tabulky -- -- -- Klíče pro tabulku `computer` -- ALTER TABLE `computer` ADD PRIMARY KEY (`Id`); -- -- AUTO_INCREMENT pro tabulky -- -- -- AUTO_INCREMENT pro tabulku `computer` -- ALTER TABLE `computer` MODIFY `Id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; COMMIT; /*!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 */;
-- phpMyAdmin SQL Dump -- version 4.8.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 04, 2019 at 05:12 PM -- Server version: 10.1.34-MariaDB -- PHP Version: 7.2.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; 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 utf8mb4 */; -- -- Database: `bbm` -- DELIMITER $$ -- -- Procedures -- CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_setCustomVal` (`sSeqName` VARCHAR(50), `sSeqGroup` VARCHAR(10), `nVal` INT UNSIGNED) BEGIN IF (SELECT COUNT(*) FROM _sequence WHERE seq_name = sSeqName AND seq_group = sSeqGroup) = 0 THEN INSERT INTO _sequence (seq_name,seq_group,seq_val) VALUES (sSeqName,sSeqGroup,nVal); ELSE UPDATE _sequence SET seq_val = nVal WHERE seq_name = sSeqName AND seq_group = sSeqGroup; END IF; END$$ -- -- Functions -- CREATE DEFINER=`root`@`localhost` FUNCTION `getNextCustomSeq` (`sSeqName` VARCHAR(50), `sSeqGroup` VARCHAR(10)) RETURNS VARCHAR(200) CHARSET latin1 BEGIN DECLARE nLast_val INT; DECLARE nLast_Year INT; DECLARE nYear INT; SET nLast_val = (SELECT seq_val FROM _sequence WHERE seq_name = sSeqName AND seq_group = sSeqGroup); SET nLast_Year = (SELECT seq_year FROM _sequence WHERE seq_name = sSeqName AND seq_group = sSeqGroup); IF nLast_val IS NULL THEN SET nLast_val = 1; INSERT INTO _sequence (seq_name,seq_group,seq_val) VALUES (sSeqName,sSeqGroup,nLast_Val); ELSE SET nLast_val = nLast_val + 1; UPDATE _sequence SET seq_val = nLast_val WHERE seq_name = sSeqName AND seq_group = sSeqGroup; END IF; SET nYear = (SELECT YEAR(CURDATE()) ); IF nLast_Year IS NOT NULL THEN IF nYear != nLast_Year THEN SET nLast_val = 1; SET nLast_Year = nYear; UPDATE _sequence SET seq_val = nLast_val, seq_year = nLast_Year WHERE seq_name = sSeqName AND seq_group = sSeqGroup; END IF; ELSE SET nLast_Year = nYear; UPDATE _sequence SET seq_year = nLast_Year WHERE seq_name = sSeqName AND seq_group = sSeqGroup; END IF; SET @ret = (SELECT concat(sSeqGroup,'_',nLast_Year,'_',lpad(nLast_val,6,'0'))); RETURN @ret; END$$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `car` -- CREATE TABLE `car` ( `id` int(10) UNSIGNED NOT NULL, `plat_number` varchar(20) NOT NULL, `brand` varchar(100) NOT NULL, `capacity` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `car` -- INSERT INTO `car` (`id`, `plat_number`, `brand`, `capacity`) VALUES (6, 'DT 1111 AS', 'pertamina A', 8000), (7, 'DT 2222 QE', 'pertamina B', 16000), (8, 'DT 3333 KJ', 'pertamina C', 24000), (9, 'DT 4444 NB', 'pertamina D', 32000), (10, 'DT 5555 SD', 'pertamina E', 40000); -- -------------------------------------------------------- -- -- Table structure for table `company` -- CREATE TABLE `company` ( `id` int(11) UNSIGNED NOT NULL, `user_id` int(11) UNSIGNED NOT NULL, `name` varchar(200) NOT NULL, `address` varchar(200) NOT NULL, `npwp` varchar(200) NOT NULL, `situ` varchar(200) NOT NULL, `siup` varchar(200) NOT NULL, `tdo` varchar(200) NOT NULL, `tdp` varchar(200) NOT NULL, `business_fields` varchar(200) NOT NULL, `pph` float UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `company` -- INSERT INTO `company` (`id`, `user_id`, `name`, `address`, `npwp`, `situ`, `siup`, `tdo`, `tdp`, `business_fields`, `pph`) VALUES (3, 23, 'PT madukubah', 'jln mutiara no 8', '1234087', '123470', '124', '123709', '871239870', '123912', 0.003); -- -------------------------------------------------------- -- -- Table structure for table `delivery_address` -- CREATE TABLE `delivery_address` ( `id` int(10) UNSIGNED NOT NULL, `code` varchar(200) NOT NULL, `name` varchar(200) NOT NULL, `city` varchar(200) NOT NULL, `postal_code` varchar(200) NOT NULL, `province` varchar(200) NOT NULL, `company_id` int(11) UNSIGNED NOT NULL, `pbbkb` float UNSIGNED NOT NULL, `discount` float UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `delivery_address` -- INSERT INTO `delivery_address` (`id`, `code`, `name`, `city`, `postal_code`, `province`, `company_id`, `pbbkb`, `discount`) VALUES (2, '11111', 'jln tipulu', 'kendari', '93126', 'sulawesi tenggara', 3, 0.0129, 0.1), (3, '11112', 'jln tapak kuda', 'kendari', '93126', 'sulawesi tenggara', 3, 0.0675, 0.2); -- -------------------------------------------------------- -- -- Table structure for table `delivery_order` -- CREATE TABLE `delivery_order` ( `id` int(10) UNSIGNED NOT NULL, `code` varchar(100) NOT NULL, `purchase_order_id` int(10) UNSIGNED NOT NULL, `car_id` int(10) UNSIGNED NOT NULL, `quantity` int(11) NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `create_date` int(10) UNSIGNED NOT NULL, `status` int(11) NOT NULL, `trip` varchar(20) NOT NULL, `travel_cost` double UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `delivery_order` -- INSERT INTO `delivery_order` (`id`, `code`, `purchase_order_id`, `car_id`, `quantity`, `user_id`, `create_date`, `status`, `trip`, `travel_cost`) VALUES (1, 'DO_2019_000017', 5, 8, 20000, 18, 1559372320, 2, 'Pertamina', 50000), (2, 'DO_2019_000018', 6, 10, 40000, 18, 1559424096, 2, 'Pertamina', 100000), (3, 'DO_2019_000019', 7, 8, 20000, 18, 1559426092, 2, 'Pertamina', 50000), (4, 'DO_2019_000020', 8, 7, 10000, 19, 1559451404, 2, 'Pertamina', 50000); -- -- Triggers `delivery_order` -- DELIMITER $$ CREATE TRIGGER `delivery_order_bi` BEFORE INSERT ON `delivery_order` FOR EACH ROW BEGIN SET NEW.code = getNextCustomSeq("delivery_order", "DO"); END $$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `do_log` -- CREATE TABLE `do_log` ( `id` int(10) UNSIGNED NOT NULL, `delivery_order_id` int(10) UNSIGNED NOT NULL, `flag` int(11) NOT NULL, `date` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `do_log` -- INSERT INTO `do_log` (`id`, `delivery_order_id`, `flag`, `date`) VALUES (1, 1, 1, 1559372561), (2, 1, 2, 1559372563), (3, 1, 3, 1559373338), (4, 2, 1, 1559424119), (5, 2, 2, 1559424121), (6, 2, 3, 1559424138), (7, 3, 1, 1559426115), (8, 3, 2, 1559426118), (9, 3, 3, 1559426135), (10, 4, 1, 1559451440), (11, 4, 2, 1559451451), (12, 4, 3, 1559451476); -- -------------------------------------------------------- -- -- Table structure for table `do_news_and_tax` -- CREATE TABLE `do_news_and_tax` ( `id` int(10) UNSIGNED NOT NULL, `delivery_order_id` int(10) UNSIGNED NOT NULL, `news` text NOT NULL, `tax_factor` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `do_news_and_tax` -- INSERT INTO `do_news_and_tax` (`id`, `delivery_order_id`, `news`, `tax_factor`) VALUES (4, 3, 'NEWS_DO_2019_000019_1559546269.pdf', 'TAX_DO_2019_000019_1559546269.pdf'), (5, 1, 'NEWS_DO_2019_000017_1559547704.pdf', 'TAX_DO_2019_000017_1559547704.pdf'); -- -------------------------------------------------------- -- -- Table structure for table `do_report` -- CREATE TABLE `do_report` ( `id` int(10) UNSIGNED NOT NULL, `delivery_order_id` int(10) UNSIGNED NOT NULL, `quantity` int(10) UNSIGNED NOT NULL, `temperature` varchar(20) NOT NULL, `tank_condition` varchar(200) NOT NULL, `quality` varchar(50) NOT NULL, `information` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `do_report` -- INSERT INTO `do_report` (`id`, `delivery_order_id`, `quantity`, `temperature`, `tank_condition`, `quality`, `information`) VALUES (1, 1, 20000, '30', 'Penutup Atas dan atau Bawah Tersegel', 'Baik', 'Tidak Terkontaminasi'), (2, 2, 39500, '30', 'Penutup Atas dan atau Bawah Tersegel', 'Baik', 'Tidak Terkontaminasi'), (3, 3, 19000, '32', 'Penutup Atas dan atau Bawah Tersegel', 'Baik', 'Tidak Terkontaminasi'), (4, 4, 10000, '30', 'Penutup Atas dan atau Bawah Tersegel', 'Baik', 'Tidak Terkontaminasi'); -- -------------------------------------------------------- -- -- Table structure for table `groups` -- CREATE TABLE `groups` ( `id` mediumint(8) UNSIGNED NOT NULL, `name` varchar(20) NOT NULL, `description` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `groups` -- INSERT INTO `groups` (`id`, `name`, `description`) VALUES (1, 'admin', 'Administrator'), (2, 'customers', 'General User'), (3, 'driver', 'driver'); -- -------------------------------------------------------- -- -- Table structure for table `invoice` -- CREATE TABLE `invoice` ( `id` int(10) UNSIGNED NOT NULL, `code` varchar(100) NOT NULL, `purchase_order_id` int(10) UNSIGNED NOT NULL, `price` float UNSIGNED NOT NULL, `quantity` int(11) NOT NULL, `date` int(11) NOT NULL, `sub_total` float UNSIGNED NOT NULL, `ppn` float UNSIGNED NOT NULL, `pph` float UNSIGNED NOT NULL, `pbbkb` float UNSIGNED NOT NULL, `total` double UNSIGNED NOT NULL, `status` int(5) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `invoice` -- INSERT INTO `invoice` (`id`, `code`, `purchase_order_id`, `price`, `quantity`, `date`, `sub_total`, `ppn`, `pph`, `pbbkb`, `total`, `status`) VALUES (1, 'INVOICE_2019_000016', 5, 9000, 20000, 1559374944, 180000000, 18000000, 0, 2322000, 200322000, 2), (2, 'INVOICE_2019_000017', 6, 9000, 39500, 1559424174, 355500000, 35550000, 1066500, 4585950, 396702450, 2), (3, 'INVOICE_2019_000018', 7, 8000, 19000, 1559426155, 152000000, 15200000, 456000, 10260000, 177916000, 2); -- -------------------------------------------------------- -- -- Table structure for table `login_attempts` -- CREATE TABLE `login_attempts` ( `id` int(11) UNSIGNED NOT NULL, `ip_address` varchar(45) NOT NULL, `login` varchar(100) NOT NULL, `time` int(11) UNSIGNED DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `material` -- CREATE TABLE `material` ( `id` int(10) UNSIGNED NOT NULL, `product_id` int(10) UNSIGNED NOT NULL, `name` varchar(200) NOT NULL, `price_1` float UNSIGNED NOT NULL, `price_2` float UNSIGNED NOT NULL, `unit` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `material` -- INSERT INTO `material` (`id`, `product_id`, `name`, `price_1`, `price_2`, `unit`) VALUES (8, 3, 'Premium', 10000, 11000, 'liter'); -- -------------------------------------------------------- -- -- Table structure for table `product` -- CREATE TABLE `product` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(200) NOT NULL, `description` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `product` -- INSERT INTO `product` (`id`, `name`, `description`) VALUES (3, 'bahan bakar minyak', 'bahan bakar minyak'); -- -------------------------------------------------------- -- -- Table structure for table `purchase_order` -- CREATE TABLE `purchase_order` ( `id` int(10) UNSIGNED NOT NULL, `code` varchar(100) NOT NULL, `vendor_id` int(10) UNSIGNED NOT NULL, `material_id` int(10) UNSIGNED NOT NULL, `delivery_address_id` int(10) UNSIGNED NOT NULL, `price` float UNSIGNED NOT NULL, `quantity` int(11) NOT NULL, `date` int(11) NOT NULL, `sub_total` float UNSIGNED NOT NULL, `ppn` float UNSIGNED NOT NULL, `pph` float UNSIGNED NOT NULL, `pbbkb` float UNSIGNED NOT NULL, `total` double UNSIGNED NOT NULL, `status` int(5) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `purchase_order` -- INSERT INTO `purchase_order` (`id`, `code`, `vendor_id`, `material_id`, `delivery_address_id`, `price`, `quantity`, `date`, `sub_total`, `ppn`, `pph`, `pbbkb`, `total`, `status`) VALUES (5, 'PO_2019_000016', 1, 8, 2, 9900, 20000, 1559200918, 198000000, 19800000, 0, 2554200, 220354200, 2), (6, 'PO_2019_000017', 1, 8, 2, 9900, 40000, 1559308677, 396000000, 39600000, 0, 5108400, 440708400, 2), (7, 'PO_2019_000018', 1, 8, 3, 8000, 20000, 1559426062, 160000000, 16000000, 480000, 10800000, 187280000, 2), (8, 'PO_2019_000019', 2, 8, 3, 8000, 10000, 1559426249, 80000000, 8000000, 240000, 5400000, 93640000, 2); -- -- Triggers `purchase_order` -- DELIMITER $$ CREATE TRIGGER `purchase_order_ci` BEFORE INSERT ON `purchase_order` FOR EACH ROW BEGIN SET NEW.code = getNextCustomSeq("purchase_order", "PO"); END $$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) UNSIGNED NOT NULL, `ip_address` varchar(45) NOT NULL, `username` varchar(100) DEFAULT NULL, `password` varchar(255) NOT NULL, `email` varchar(254) NOT NULL, `activation_selector` varchar(255) DEFAULT NULL, `activation_code` varchar(255) DEFAULT NULL, `forgotten_password_selector` varchar(255) DEFAULT NULL, `forgotten_password_code` varchar(255) DEFAULT NULL, `forgotten_password_time` int(11) UNSIGNED DEFAULT NULL, `remember_selector` varchar(255) DEFAULT NULL, `remember_code` varchar(255) DEFAULT NULL, `created_on` int(11) UNSIGNED NOT NULL, `last_login` int(11) UNSIGNED DEFAULT NULL, `active` tinyint(1) UNSIGNED DEFAULT NULL, `first_name` varchar(50) DEFAULT NULL, `last_name` varchar(50) DEFAULT NULL, `phone` varchar(20) DEFAULT NULL, `image` text NOT NULL, `address` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `ip_address`, `username`, `password`, `email`, `activation_selector`, `activation_code`, `forgotten_password_selector`, `forgotten_password_code`, `forgotten_password_time`, `remember_selector`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`, `phone`, `image`, `address`) VALUES (1, '127.0.0.1', 'admin', '$2y$12$qDOWoHGT36XJXrbRexNNreZCKWqDcqiIbpNb3yxgxIzlnMEACZwcm', '<EMAIL>', NULL, '', NULL, NULL, NULL, NULL, NULL, 1268889823, 1559636515, 1, 'alan', 'madukubah', '081342989185', 'USER_1_1557662206.jpg', 'jln mutiara no 8'), (18, '::1', 'DRV_1', '$2y$10$51nmMUyOHw/bsXeHv66xqexSQdyq7NrdwRMzccA5X9j0YqmZUI9Te', '<EMAIL>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1558525437, 1559451350, 1, 'Driver A', 'Driver A', '098712346543', 'USER_18_1559202064.jpg', 'alamat'), (19, '::1', 'DRV_2', '$2y$10$SrLctPAt8n/yLNyyGBJso.U.9SYR6f9ACSqS5fgz5yRRDKT6GmdKm', '<EMAIL>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1558527551, 1559451420, 1, 'Alun', 'madukubah', '012334569687', 'USER_19_1558529038.jpg', 'jln tipulu'), (20, '::1', 'DRV_3', '$2y$10$XKE9sPXBfAntCdfyTQzeBuBQwHYI4Adni2n4Jkn35i8qDO890mR6K', '<EMAIL>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1558527681, NULL, 1, 'alin', 'xyz', '087919284930', '', 'jln mandonga'), (23, '::1', '1111', '$2y$10$MIAB3hUgEry4TeyfGL93heZr6mO2QJDBAf7Kve1aFKAzzqvtBXxde', '<EMAIL>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1559200026, 1559595604, 1, '1', '1', '1', 'USER_23_1559201932.jpg', '1'); -- -------------------------------------------------------- -- -- Table structure for table `users_groups` -- CREATE TABLE `users_groups` ( `id` int(11) UNSIGNED NOT NULL, `user_id` int(11) UNSIGNED NOT NULL, `group_id` mediumint(8) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_groups` -- INSERT INTO `users_groups` (`id`, `user_id`, `group_id`) VALUES (1, 1, 1), (2, 1, 2), (29, 18, 3), (30, 19, 3), (31, 20, 3), (34, 23, 2); -- -------------------------------------------------------- -- -- Table structure for table `vendor` -- CREATE TABLE `vendor` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(100) NOT NULL, `address` varchar(200) NOT NULL, `phone` varchar(20) NOT NULL, `phone_2` varchar(50) NOT NULL, `description` text NOT NULL, `bank_account` varchar(50) NOT NULL, `bank_name` varchar(100) NOT NULL, `bank_branch` varchar(100) NOT NULL, `swift_code` varchar(100) NOT NULL, `email` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `vendor` -- INSERT INTO `vendor` (`id`, `name`, `address`, `phone`, `phone_2`, `description`, `bank_account`, `bank_name`, `bank_branch`, `swift_code`, `email`) VALUES (1, 'PT Harum Bumi Mandiri', 'Jln Ronga III No.87', '0401-3123003', '53588061', 'PT harum bumi mandiri', '900-1234-1232-4', 'BRI', 'kendari', '1231', '<EMAIL>'), (2, 'PT. Energi Nusantara Mandiri', 'Jln Pembangunan Komp TPPI Kendari', '0401-312-3922', '0812-4229-7683', 'Energi Nusantara Mandiri', '230-00-123465-9', 'Mandiri', 'kendari', '3123', '<EMAIL>'); -- -------------------------------------------------------- -- -- Table structure for table `_sequence` -- CREATE TABLE `_sequence` ( `seq_name` varchar(50) NOT NULL, `seq_group` varchar(10) NOT NULL, `seq_year` int(11) NOT NULL, `seq_val` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `_sequence` -- INSERT INTO `_sequence` (`seq_name`, `seq_group`, `seq_year`, `seq_val`) VALUES ('delivery_order', 'DO', 2019, 20), ('purchase_order', 'PO', 2019, 19); -- -- Indexes for dumped tables -- -- -- Indexes for table `car` -- ALTER TABLE `car` ADD PRIMARY KEY (`id`); -- -- Indexes for table `company` -- ALTER TABLE `company` ADD PRIMARY KEY (`id`), ADD KEY `customer_id` (`user_id`); -- -- Indexes for table `delivery_address` -- ALTER TABLE `delivery_address` ADD PRIMARY KEY (`id`), ADD KEY `delivery_address_ibfk_1` (`company_id`); -- -- Indexes for table `delivery_order` -- ALTER TABLE `delivery_order` ADD PRIMARY KEY (`id`), ADD KEY `purchase_order_id` (`purchase_order_id`); -- -- Indexes for table `do_log` -- ALTER TABLE `do_log` ADD PRIMARY KEY (`id`); -- -- Indexes for table `do_news_and_tax` -- ALTER TABLE `do_news_and_tax` ADD PRIMARY KEY (`id`), ADD KEY `delivery_order_id` (`delivery_order_id`); -- -- Indexes for table `do_report` -- ALTER TABLE `do_report` ADD PRIMARY KEY (`id`); -- -- Indexes for table `groups` -- ALTER TABLE `groups` ADD PRIMARY KEY (`id`); -- -- Indexes for table `invoice` -- ALTER TABLE `invoice` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `purchase_order_id` (`purchase_order_id`), ADD KEY `delivery_address_id` (`purchase_order_id`); -- -- Indexes for table `login_attempts` -- ALTER TABLE `login_attempts` ADD PRIMARY KEY (`id`); -- -- Indexes for table `material` -- ALTER TABLE `material` ADD PRIMARY KEY (`id`), ADD KEY `product_id` (`product_id`); -- -- Indexes for table `product` -- ALTER TABLE `product` ADD PRIMARY KEY (`id`); -- -- Indexes for table `purchase_order` -- ALTER TABLE `purchase_order` ADD PRIMARY KEY (`id`), ADD KEY `material_id` (`material_id`), ADD KEY `vendor_id` (`vendor_id`), ADD KEY `delivery_address_id` (`delivery_address_id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `uc_activation_selector` (`activation_selector`), ADD UNIQUE KEY `uc_forgotten_password_selector` (`forgotten_password_selector`), ADD UNIQUE KEY `uc_remember_selector` (`remember_selector`); -- -- Indexes for table `users_groups` -- ALTER TABLE `users_groups` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`), ADD KEY `fk_users_groups_users1_idx` (`user_id`), ADD KEY `fk_users_groups_groups1_idx` (`group_id`); -- -- Indexes for table `vendor` -- ALTER TABLE `vendor` ADD PRIMARY KEY (`id`); -- -- Indexes for table `_sequence` -- ALTER TABLE `_sequence` ADD PRIMARY KEY (`seq_name`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `car` -- ALTER TABLE `car` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `company` -- ALTER TABLE `company` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `delivery_address` -- ALTER TABLE `delivery_address` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `delivery_order` -- ALTER TABLE `delivery_order` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `do_log` -- ALTER TABLE `do_log` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `do_news_and_tax` -- ALTER TABLE `do_news_and_tax` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `do_report` -- ALTER TABLE `do_report` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `groups` -- ALTER TABLE `groups` MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `invoice` -- ALTER TABLE `invoice` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `login_attempts` -- ALTER TABLE `login_attempts` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `material` -- ALTER TABLE `material` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `product` -- ALTER TABLE `product` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `purchase_order` -- ALTER TABLE `purchase_order` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT for table `users_groups` -- ALTER TABLE `users_groups` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35; -- -- AUTO_INCREMENT for table `vendor` -- ALTER TABLE `vendor` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- Constraints for dumped tables -- -- -- Constraints for table `company` -- ALTER TABLE `company` ADD CONSTRAINT `company_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); -- -- Constraints for table `delivery_address` -- ALTER TABLE `delivery_address` ADD CONSTRAINT `delivery_address_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `company` (`id`); -- -- Constraints for table `delivery_order` -- ALTER TABLE `delivery_order` ADD CONSTRAINT `delivery_order_ibfk_1` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_order` (`id`); -- -- Constraints for table `do_news_and_tax` -- ALTER TABLE `do_news_and_tax` ADD CONSTRAINT `do_news_and_tax_ibfk_1` FOREIGN KEY (`delivery_order_id`) REFERENCES `delivery_order` (`id`); -- -- Constraints for table `invoice` -- ALTER TABLE `invoice` ADD CONSTRAINT `invoice_ibfk_1` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_order` (`id`); -- -- Constraints for table `material` -- ALTER TABLE `material` ADD CONSTRAINT `material_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`); -- -- Constraints for table `purchase_order` -- ALTER TABLE `purchase_order` ADD CONSTRAINT `purchase_order_ibfk_1` FOREIGN KEY (`material_id`) REFERENCES `material` (`id`), ADD CONSTRAINT `purchase_order_ibfk_2` FOREIGN KEY (`vendor_id`) REFERENCES `vendor` (`id`), ADD CONSTRAINT `purchase_order_ibfk_3` FOREIGN KEY (`delivery_address_id`) REFERENCES `delivery_address` (`id`); -- -- Constraints for table `users_groups` -- ALTER TABLE `users_groups` ADD CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION, ADD CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION; COMMIT; /*!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 */;
/* * BooleanLiteral.sql * Chapter 3, Oracle10g PL/SQL Programming * by <NAME>, <NAME>, <NAME> * * This script demonstrates Boolean literals */ exec clean_schema.trigs exec clean_schema.procs exec clean_schema.tables SET SERVEROUTPUT ON PROMPT PROMPT ** The following example shows how Boolean variables PROMPT ** can be evaluated. PROMPT DECLARE v_true BOOLEAN := TRUE; v_false BOOLEAN := FALSE; v_null BOOLEAN := NULL; BEGIN IF v_true THEN DBMS_OUTPUT.PUT_LINE('true'); END IF; IF v_false THEN DBMS_OUTPUT.PUT_LINE('false'); END IF; IF v_null THEN DBMS_OUTPUT.PUT_LINE('null'); END IF; END; /
CREATE TABLE Movie ( ID INT AUTO_INCREMENT, Title VARCHAR(100), Rating CHAR(5) CHECK (Rating IN ('G', 'PG', 'PG-13', 'R')), ReleaseDate DATE, PRIMARY KEY (ID) ); INSERT INTO Movie (Title, Rating, ReleaseDate) VALUES ('Casablanca', 'PG', '1943-01-23'), ('Bridget Jones\'s Diary', 'PG-13', '2001-04-13'), ('The Dark Knight', 'PG-13', '2008-07-18'), ('Hidden Figures', 'PG', '2017-01-06'), ('Toy Story', 'G', '1995-11-22'), ('Rocky', 'PG', '1976-11-21'), ('Crazy Rich Asians', 'PG-13', '2018-08-15'); SELECT * FROM Movie WHERE ReleaseDate < '2008-02-01' && Rating != 'R';
<gh_stars>0 --codigo receita, nome_receita, agrupar valores por data select * from pt_receitadetalhe limit 100 select * from receitacodigotcm limit 100 select split_part(pt_receitadetalhe.receitacodigotcmid, '.', 2), sum(pt_receitadetalhe.pt_receitadetalhevalor), receitacodigotcm.receitacodigotcmdescricao from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid --where substring(pt_receitadetalhe.receitacodigotcmid,1, 1) = '1' where pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' group by pt_receitadetalhe.receitacodigotcmid, receitacodigotcm.receitacodigotcmdescricao order by pt_receitadetalhe.receitacodigotcmid select sum(pt_receitadetalhe.pt_receitadetalhevalor) from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 3) = '112' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' select * from receitacodigotcm where receitacodigotcm.receitacodigotcmaceita = '' order by receitacodigotcmid select * from receitacodigotcm where receitacodigotcm.receitacodigotcmaceita = 'F' order by receitacodigotcmid -- select receitacodigotcm.receitacodigotcmid, count(*) from receitacodigotcm -- group by receitacodigotcm.receitacodigotcmid select receitacodigotcm.receitacodigotcmdescricao, count(*) from receitacodigotcm group by receitacodigotcm.receitacodigotcmdescricao order by count(*) desc select * from receitacodigotcm where receitacodigotcm.receitacodigotcmdescricao like 'TRANSFERÊNCIAS A CONSÓRCIOS PÚBLICOS%' union select * from receitacodigotcm where receitacodigotcm.receitacodigotcmdescricao like 'Extra Orçamentária%' union select * from receitacodigotcm where receitacodigotcm.receitacodigotcmdescricao like 'TRANSFERÊNCIAS DE RECURSOS DESTINADOS A PROGRAMAS DE EDUCAÇÃO%' union select * from receitacodigotcm where receitacodigotcm.receitacodigotcmdescricao like 'TRANSFERÊNCIAS DE RECURSOS DO SISTEMA ÚNICO DE SAÚDE – SUS%' union select * from receitacodigotcm where receitacodigotcm.receitacodigotcmdescricao like '(-)DEDUÇÃO DE RECEITA PARA A FORMAÇÃO DO FUNDEB – COTA PARTE ICMS%' order by receitacodigotcmdescricao --TRANSFERÊNCIAS A CONSÓRCIOS PÚBLICOS - 4 --Extra Orçamentária - 4 --TRANSFERÊNCIAS DE RECURSOS DESTINADOS A PROGRAMAS DE EDUCAÇÃO - 3 --TRANSFERÊNCIAS DE RECURSOS DO SISTEMA ÚNICO DE SAÚDE – SUS - 3 --(-)DEDUÇÃO DE RECEITA PARA A FORMAÇÃO DO FUNDEB – COTA PARTE ICMS - 2 ORDER BY receitacodigotcmid where substring(receitacodigotcmid, 1, 4) = '1000' UNION select * from receitacodigotcm where substring(receitacodigotcmid, 1, 4) = '1100' UNION SELECT * FROM receitacodigotcm where split_part(receitacodigotcm.receitacodigotcmid, '.', 4) = '00' AND split_part(receitacodigotcm.receitacodigotcmid, '.', 3) = '00' AND split_part(receitacodigotcm.receitacodigotcmid, '.', 2) = '00' order by receitacodigotcmid select sum(pt_receitadetalhe.pt_receitadetalhevalor) from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 1) = '1' and substring(pt_receitadetalhe.receitacodigotcmid,1, 2) = '11' and substring(pt_receitadetalhe.receitacodigotcmid,1, 3) = '111' and substring(pt_receitadetalhe.receitacodigotcmid,1, 4) = '1112' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' select * from pt_receitadetalhecodigo limit 100 select pt_receitadetalhecodigo, pt_receitadetalhevalor, receitadetalhecodigotcmdescricao from pt_receitadetalhe --select sum(pt_receitadetalhe.pt_receitadetalhevalor) from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 1) = '1' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' select sum(pt_receitadetalhe.pt_receitadetalhevalor) from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 2) = '11' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' select sum(pt_receitadetalhe.pt_receitadetalhevalor) from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 1) = '1' and substring(pt_receitadetalhe.receitacodigotcmid,1, 2) = '11' and substring(pt_receitadetalhe.receitacodigotcmid,1, 3) = '111' and substring(pt_receitadetalhe.receitacodigotcmid,1, 4) = '1112' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' --OK OK OK OK OK OK -- select pt_receitadetalhe.receitacodigotcmid, -- sum(pt_receitadetalhe.pt_receitadetalhevalor), -- receitacodigotcm.receitacodigotcmdescricao select '1000.00.00.00' as codigo, sum(pt_receitadetalhe.pt_receitadetalhevalor), 'RECEITAS CORRENTES' as descricao from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 1) = '1' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' UNION select '1100.00.00.00' as codigo, sum(pt_receitadetalhe.pt_receitadetalhevalor), 'RECEITA TRIBUTARIA' as descricao from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 2) = '11' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' UNION select '1110.00.00.00' as codigo, sum(pt_receitadetalhe.pt_receitadetalhevalor), 'IMPOSTOS' as descricao from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 3) = '111' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' UNION select '1112.00.00.00' as codigo, sum(pt_receitadetalhe.pt_receitadetalhevalor), 'IMPOSTOS SOBRE O PATRIMÔNIO E A RENDA' as descricao from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 4) = '1112' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' UNION select '2000.00.00.00' as codigo, sum(pt_receitadetalhe.pt_receitadetalhevalor), 'RECEITAS DE CAPITAL' as descricao from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 1) = '2' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' UNION select '2200.00.00.00' as codigo, sum(pt_receitadetalhe.pt_receitadetalhevalor), 'ALIENAÇÃO DE BENS' as descricao from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 2) = '22' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' UNION select '2220.00.00.00' as codigo, sum(pt_receitadetalhe.pt_receitadetalhevalor), 'ALIENAÇÃO DE BENS IMÓVEIS' as descricao from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 3) = '222' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' UNION select '2220.00.00.00' as codigo, sum(pt_receitadetalhe.pt_receitadetalhevalor), 'ALIENAÇÃO DE BENS IMÓVEIS' as descricao from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 3) = '222' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' UNION --todas as outras consultas select pt_receitadetalhe.receitacodigotcmid as codigo, sum(pt_receitadetalhe.pt_receitadetalhevalor), receitacodigotcm.receitacodigotcmdescricao as descricao from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where cast(substring(pt_receitadetalhe.receitacodigotcmid,1, 3) as integer) > 0 and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' group by pt_receitadetalhe.receitacodigotcmid, receitacodigotcm.receitacodigotcmdescricao order by codigo --order by pt_receitadetalhe.receitacodigotcmid select * from pt_receitadetalhe where cast(split_part(pt_receitadetalhe.receitacodigotcmid, '.', 1) as integer) > 0 and cast(split_part(pt_receitadetalhe.receitacodigotcmid, '.', 3) as integer) = 0 and cast(split_part(pt_receitadetalhe.receitacodigotcmid, '.', 4) as integer) = 0 and cast(split_part(pt_receitadetalhe.receitacodigotcmid, '.', 2) as integer) = 0 select * from pt_receitadetalhe where pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' --and split_part(pt_receitadetalhe.receitacodigotcmid, '.', 2) = '00' and split_part(pt_receitadetalhe.receitacodigotcmid, '.', 3) = '00' and split_part(pt_receitadetalhe.receitacodigotcmid, '.', 4) = '00' order by receitacodigotcmid select split_part(pt_receitadetalhe.receitacodigotcmid, '.', 1) as codigo from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid --where substring(pt_receitadetalhe.receitacodigotcmid,1, 1) = '1' where pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' group by codigo order by codigo --Codigos do primeiro bloco - tabela codigos TCM select split_part(receitacodigotcmid, '.', 1) as codigo from receitacodigotcm group by codigo order by codigo -- Na coluna receitacodigotcmaceita o F significa o final do estrutural, o último item. -- Deve-se fazer a soma até o F -- O FINAL É ZERO? SE SIM, VERIFICA SE TEM F. SE NÃO TEM F, SEGUE PARA PROXIMA LINHA E CONTINUA A VERIFICAÇÃO select * from receitacodigotcm order by receitacodigotcmid where split_part(receitacodigotcmid, '.', 2) = '00' and split_part(receitacodigotcmid, '.', 3) != '00' and split_part(receitacodigotcmid, '.', 4) != '00' select concat(split_part(receitacodigotcmid, '.', 1), split_part(receitacodigotcmid, '.', 2), split_part(receitacodigotcmid, '.', 3), split_part(receitacodigotcmid, '.', 4)) as cod_tcm, receitacodigotcmaceita, receitacodigotcmdescricao from receitacodigotcm where cod_tcm = 1000000000 order by cod_tcm --seleciona codigos TCM sem separação por pontuação, codigos do tipo numeric select concat(split_part(receitacodigotcmid, '.', 1), split_part(receitacodigotcmid, '.', 2), split_part(receitacodigotcmid, '.', 3), split_part(receitacodigotcmid, '.', 4)) as cod_tcm, receitacodigotcmaceita, receitacodigotcmdescricao from receitacodigotcm where cast(concat(split_part(receitacodigotcmid, '.', 1), split_part(receitacodigotcmid, '.', 2), split_part(receitacodigotcmid, '.', 3), split_part(receitacodigotcmid, '.', 4)) as numeric) < 2000000000 and cast(concat(split_part(receitacodigotcmid, '.', 1), split_part(receitacodigotcmid, '.', 2), split_part(receitacodigotcmid, '.', 3), split_part(receitacodigotcmid, '.', 4)) as numeric) >= 0 and cast(concat(split_part(receitacodigotcmid, '.', 1), split_part(receitacodigotcmid, '.', 2), split_part(receitacodigotcmid, '.', 3), split_part(receitacodigotcmid, '.', 4)) as numeric) < 2000000000 and cast(concat(split_part(receitacodigotcmid, '.', 1), split_part(receitacodigotcmid, '.', 2), split_part(receitacodigotcmid, '.', 3), split_part(receitacodigotcmid, '.', 4)) as numeric) <= 2000000000 order by cod_tcm select cast(concat(split_part(receitacodigotcmid, '.', 1), split_part(receitacodigotcmid '.', 2), split_part(receitacodigotcmid, '.', 3), split_part(receitacodigotcmid, '.', 4)) as integer) as codigo from receitacodigotcm order by receitacodigotcmid select * from pt_consultareceitadetalhe where cast(concat(split_part(detalheconsultareceitacodigo, '.', 1), split_part(detalheconsultareceitacodigo, '.', 2), split_part(detalheconsultareceitacodigo, '.', 3), split_part(detalheconsultareceitacodigo, '.', 4)) as numeric) = 0000000000 and detalheconsultareceitavalor = 61119101.36 and cast(concat(split_part(receitacodigotcmid, '.', 1), split_part(receitacodigotcmid, '.', 2), split_part(receitacodigotcmid, '.', 3), split_part(receitacodigotcmid, '.', 4)) as numeric) >= 1000000000 -- where split_part(detalheconsultareceitacodigo, '.', 2) = '00' and split_part(detalheconsultareceitacodigo, '.', 3) = '00' and detalheconsultareceitavalor = 6415231.19 order by detalheconsultareceitacodigo select * from pt_consultareceitadetalhe join pt_consultareceita on pt_consultareceitadetalhe.pt_consultareceitaid = pt_consultareceita.pt_consultareceitaid where pt_consultareceitadata BETWEEN '2018-12-01' AND '2018-12-31' -- group by detalheconsultareceitadescricao order by pt_consultareceitadetalhe.detalheconsultareceitacodigo select sum(pt_receitadetalhe.pt_receitadetalhevalor) from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 4) = '1113' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' select * from pt_receitadetalhe JOIN receitacodigotcm on pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid where substring(pt_receitadetalhe.receitacodigotcmid,1, 1) = '1' and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' order by receitacodigotcm.receitacodigotcmid select * from pt_receitadetalhe where pt_receitadetalhe.receitacodigotcmid in (select receitacodigotcm.receitacodigotcmid from receitacodigotcm where pt_receitadetalhe.receitacodigotcmid = receitacodigotcm.receitacodigotcmid ) and pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' order by pt_receitadetalhedata select pt_receitadetalhe.pt_receitadetalhedata, pt_receitadetalhe.receitacodigotcmid, receitacodigotcm.receitacodigotcmdescricao, pt_receitadetalhe.pt_receitadetalhevalor, receitacodigotcm.receitacodigotcmaceita from pt_receitadetalhe join receitacodigotcm on receitacodigotcm.receitacodigotcmid = pt_receitadetalhe.receitacodigotcmid where pt_receitadetalhedata BETWEEN '2018-12-01' AND '2018-12-31' -- and receitacodigotcm.receitacodigotcmaceita = '' order by pt_receitadetalhe.pt_receitadetalhedata, pt_receitadetalhe.receitacodigotcmid select * from receitacodigotcm where receitacodigotcm.receitacodigotcmaceita = '' order by receitacodigotcmid -- Tabela de Receitas select * from receitacodigotcm order by receitacodigotcmid
-- ===================================================================================================== -- Generated by Data Dictionary Version 1.0.0.0 -- Date: 18 July 2016 10:27 -- Profile: 1516 Test Harness Validation -- Rulebase Version: ILR Trailblazer Validation 1617, Drop 000, Version 1617.03 -- ===================================================================================================== use [$(IntrajobDatabase)] go insert into [Valid].[CollectionDetails] ( [CollectionDetails_Id], [FilePreparationDate] ) select [CollectionDetails_Id], [FilePreparationDate] from [$(FromILRDatabase)].[$(FromILRSchema)].[CollectionDetailsDenorm] CollectionDetails where [CollectionDetails].[UKPRN]=$(UKPRN) go insert into [Valid].[LearningProvider] ( [LearningProvider_Id], [UKPRN] ) select [LearningProvider_Id], [UKPRN] from [$(FromILRDatabase)].[$(FromILRSchema)].[LearningProviderDenorm] LearningProvider where [LearningProvider].[UKPRN]=$(UKPRN) go insert into [Valid].[Learner] ( [Learner_Id], [LearnRefNumber] ) select [Learner_Id], [LearnRefNumber] from [$(FromILRDatabase)].[$(FromILRSchema)].[LearnerDenorm] Learner where [Learner].[UKPRN]=$(UKPRN) go insert into [Valid].[LearnerEmploymentStatus] ( [LearnerEmploymentStatus_Id], [DateEmpStatApp] ) select [LearnerEmploymentStatus_Id], [DateEmpStatApp] from [$(FromILRDatabase)].[$(FromILRSchema)].[LearnerEmploymentStatusDenorm] LearnerEmploymentStatus where [LearnerEmploymentStatus].[UKPRN]=$(UKPRN) go insert into [Valid].[EmploymentStatusMonitoring] ( [EmploymentStatusMonitoring_Id], [ESMCode], [ESMType] ) select [EmploymentStatusMonitoring_Id], [ESMCode], [ESMType] from [$(FromILRDatabase)].[$(FromILRSchema)].[EmploymentStatusMonitoringDenorm] EmploymentStatusMonitoring where [EmploymentStatusMonitoring].[UKPRN]=$(UKPRN) go insert into [Valid].[LearningDelivery] ( [LearningDelivery_Id], [AimSeqNumber], [AimType], [CompStatus], [FundModel], [LearnActEndDate], [LearnAimRef], [LearnPlanEndDate], [LearnStartDate], [OrigLearnStartDate], [ProgType], [StdCode] ) select [LearningDelivery_Id], [AimSeqNumber], [AimType], [CompStatus], [FundModel], [LearnActEndDate], [LearnAimRef], [LearnPlanEndDate], [LearnStartDate], [OrigLearnStartDate], [ProgType], [StdCode] from [$(FromILRDatabase)].[$(FromILRSchema)].[LearningDeliveryDenorm] LearningDelivery where [LearningDelivery].[UKPRN]=$(UKPRN) go insert into [Valid].[TrailblazerApprenticeshipFinancialRecord] ( [TrailblazerApprenticeshipFinancialRecord_Id], [TBFinAmount], [TBFinCode], [TBFinDate], [TBFinType] ) select [TrailblazerApprenticeshipFinancialRecord_Id], [TBFinAmount], [TBFinCode], [TBFinDate], [TBFinType] from [$(FromILRDatabase)].[$(FromILRSchema)].[TrailblazerApprenticeshipFinancialRecordDenorm] TrailblazerApprenticeshipFinancialRecord where [TrailblazerApprenticeshipFinancialRecord].[UKPRN]=$(UKPRN) go insert into [Valid].[LearningDeliveryFAM] ( [LearningDeliveryFAM_Id], [LearnDelFAMCode], [LearnDelFAMDateFrom], [LearnDelFAMDateTo], [LearnDelFAMType] ) select [LearningDeliveryFAM_Id], [LearnDelFAMCode], [LearnDelFAMDateFrom], [LearnDelFAMDateTo], [LearnDelFAMType] from [$(FromILRDatabase)].[$(FromILRSchema)].[LearningDeliveryFAMDenorm] LearningDeliveryFAM where [LearningDeliveryFAM].[UKPRN]=$(UKPRN) go
CREATE OR REPLACE FUNCTION test_global_transformer_6(a timestamp) RETURNS timestamp AS $$ BEGIN RETURN a; END; $$ LANGUAGE plpgsql SECURITY DEFINER;
/*####################################################################################################### # TYPE: Stored Procedure # # NAME: deletedatabase # # SUMMARY: Deletes a database. # # PARAMETERS: database name, user name # # RETURNS: status message (string) # # CREATED BY: <NAME> and <NAME> # #######################################################################################################*/ -- Function: deletedatabase(text, text) -- DROP FUNCTION deletedatabase(text, text); CREATE OR REPLACE FUNCTION deletedatabase( text, text ) RETURNS text AS $BODY$ DECLARE _databaseName ALIAS FOR $1; -- Unique user identifier _reqUser ALIAS FOR $2; -- Users name _req_user_id integer; -- Requesting users id _req_user_access boolean := false; -- Requesting users delete access rights --_user_id integer; -- Returned user id after removal _database_deleted boolean := false; -- Database deleted status _response text; -- Response message begin /* Check that the requesting user is not null or blank */ if _reqUser is null or _reqUser = '' then raise exception 'deletedatabase: ERROR DELETING DATABASE AS REQUESTING USER "%" IS NULL OR BLANK', _reqUser; end if; /* Check that the requesting user exists */ if (select exists(select 1 from "user" where upper("UserName") = upper(_reqUser))) is true then select "Id" from "user" into _req_user_id where upper("UserName") = upper(_reqUser); if _req_user_id is null then raise exception 'deletedatabase: ERROR DELETING DATABASE AS REQUESTING USER "%" DOES NOT EXIST!', _reqUser; end if; end if; /* Check that the requesting user has access to delete a database */ select checkaccess(_req_user_id, 'deletedatabase') into _req_user_access; if _req_user_access is false then raise exception 'deletedatabase: ERROR DELETING DATABASE AS REQUESTING USER "%" DOES NOT HAVE ACCESS TO "DELETE DATABASE"!', _reqUser; end if; /* Verify that the database exists */ if (select Exists(select 1 from pg_database where datname=_databaseName)) is false then raise exception 'deletedatabase: ERROR DELETING DATABASE AS DATABASE "%" DOES NOT EXIST!', _databaseName; end if; /* Add database removed timestamp */ --update "Database" set "DatabaseRemoved" = now()::timestamp without time zone where upper("UserName") = upper(_userName) and "UserKey" = _userKey; --create database _databaseName; PERFORM dblink_exec('dbname=' || current_database(), 'DROP DATABASE ' || quote_ident(_databaseName)); -- || ' OWNER "' || _userRole || '"'); /* Verify database was deleted successfully */ if (select Exists(select 1 from pg_database where datname=_databaseName)) is true then raise exception 'deletedatabase: ERROR DELETING DATABASE AS DATABASE "%" STILL EXISTS!', _databaseName; else _database_deleted := true; _response := 'deletedatabase: DATABASE "' || _databaseName || '" WAS DELETED SUCCESSFULLY BY REQUESTING USER "' || _reqUser || '"'; end if; return _response; -- Return database deleted response message end; $BODY$ language plpgsql volatile cost 100; alter function deletedatabase(text, text) owner to postgres; COMMENT ON function deletedatabase(text, text) IS '[*New* --Marcus--] Deletes a database';
<filename>zs_m_live/ZS_LIVE_2_2_BOOLEAN_TYPE.sql<gh_stars>1-10 /* SHOW search_path; ALTER DATABASE <database_name> SET search_path TO schema1,schema2; ALTER ROLE <role_name> SET search_path TO schema1,schema2; */ CREATE TABLE test2 ( field text ); INSERT INTO test2 VALUES ('Yes'), ('No'),('Y'),('N'),('1'),('0'),('True'),('False'); SELECT *, CAST(field AS BOOLEAN) FROM test2; INSERT INTO test2 VALUES ('YEEES'); SELECT * FROM test2; SELECT * FROM test3; CREATE TABLE test3 ( field boolean ); INSERT INTO test3 VALUES ('Yes');
<reponame>Darkr4ptor/WCPStandard<gh_stars>1-10 /* SQLyog Community v13.1.1 (64 bit) MySQL - 10.1.29-MariaDB : Database - wcps-authentication ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`wcps-authentication` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci */; USE `wcps-authentication`; /*Table structure for table `server_statistics` */ DROP TABLE IF EXISTS `server_statistics`; CREATE TABLE `server_statistics` ( `ID` smallint(6) NOT NULL, `name` varchar(20) DEFAULT NULL, `type` tinyint(4) DEFAULT NULL, `users_online` bigint(20) DEFAULT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*Data for the table `server_statistics` */ /*Table structure for table `users` */ DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `displayname` char(16) CHARACTER SET latin1 DEFAULT NULL, `password` char(64) CHARACTER SET latin1 DEFAULT NULL, `salt` char(10) CHARACTER SET latin1 DEFAULT NULL, `rights` tinyint(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; /*Data for the table `users` */ insert into `users`(`ID`,`username`,`displayname`,`password`,`salt`,`rights`) values (1,'test','Dark<PASSWORD>','<PASSWORD>','<PASSWORD>',1), (2,'test2','<PASSWORD>','<PASSWORD>','asd',0); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
<reponame>ericminio/learning-sqlserver @@./oracle/init.sql execute drop_table_if_exists('event'); create table event( type varchar2(10) not null, label varchar2(50) not null ); insert into event(type, label) values('MATCH', 'new year'); insert into event(type, label) values('MATCH', 'new month'); insert into event(type, label) values('MATCH', 'new day'); insert into event(type, label) values('MATCH', 'new hour'); insert into event(type, label) values('MATCH', 'new minute');
INSERT INTO users(id, name, role_id, email, password) VALUES (1, 'Gerhard', 1, '<EMAIL>', 'asd'), (2, 'Alien', 2, '<EMAIL>', 'asd');
drop database if exists `pro_x`; create database `pro_x`; use `pro_x`; create table if not exists `user_status` ( `id` int(4) not null auto_increment, `name` varchar(30) not null, `description` text null, primary key (`id`) ); create table if not exists `user_role` ( `id` int(4) not null auto_increment, `name` varchar(30) not null, `description` text null, primary key (`id`) ); create table if not exists `user` ( `id` int(4) not null auto_increment, `unique_id` varchar(10) not null, `user_status_id` int(4) not null, `user_role_id` int(4) not null, `fullname` varchar(80) not null, `gender` varchar(20) not null, `phone_no` varchar(15) not null, `email` varchar(50) null, `username` varchar(30) not null, `password` varchar(255) not null, `passport_url` varchar(255) null, `created_at` datetime not null, `updated_at` datetime not null, primary key (`id`), foreign key (`user_status_id`) references user_status(`id`), foreign key (`user_role_id`) references user_role(`id`) ); create table if not exists `module` ( `id` int(4) not null auto_increment, `name` varchar(30) not null, `description` text null, primary key (`id`) ); create table if not exists `accessibility` ( `id` int(4) not null auto_increment, `user_id` int(4) not null, `module_id` int(4) not null, `created_at` datetime not null, primary key (`id`) ); create table if not exists `category` ( `id` int(8) not null auto_increment, `name` varchar(30) not null, `description` text null, `created_at` datetime not null, `updated_at` datetime not null, primary key (`id`) ); create table if not exists `product` ( `id` int(8) not null auto_increment, `category_id` int(8) not null, `user_id` int(4) not null, `brand_name` varchar(100) not null, `batch_no` varchar(50) not null, `production_date` datetime not null, `expiry_date` datetime not null, `initial_qty` int(10) not null, `sold_qty` int(10) not null, `weight` varchar(30) null, `created_at` datetime not null, `updated_at` datetime not null, primary key (`id`), foreign key (`category_id`) references category(`id`), foreign key (`user_id`) references user(`id`) ); insert into user_status (`name`, `description`) values ('Active', 'This user is active.'), ('Suspended', 'This user has been suspended.'), ('Fired', 'This user was fired.'), ('Retired', 'This user is retired.'), ('Resigned', 'This user resigned.'); insert into user_role (`name`, `description`) values ('Administrator', 'This is the default admin, has access to the whole modules.'), ('Manager', 'This is the owner of the shop.'), ('Staff', 'This is an employee.'); insert into user (`unique_id`, `user_status_id`, `user_role_id`, `fullname`, `gender`, `phone_no`, `email`, `username`, `password`, `passport_url`, `created_at`, `updated_at`) values ('uyY87jaK', 1, 1, 'Default Administrator', 'rather not say', '+2340123456789', 'machine@<EMAIL>', 'machine', '$2y$10$nNSlA.PMMaxvMKWpCtFXf.O71O5vF9C5vhn.gFiq..seTO85vhEmy', null, NOW(), NOW()); -- password = <PASSWORD> commit;
-- file:privileges.sql ln:933 expect:true ALTER DEFAULT PRIVILEGES GRANT ALL ON SCHEMAS TO regress_user2
INVALID TEST -- It is not possible to test createFunction change type with current test-harness build. H2 supports only Java/JQQQ written -- functions which should be passed to a database classpath (which is currently dockerized)
set echo off set feedback off set verify off set linesize 500 set pages 100 REM ---------------------------------------------------------------- REM File name : sel_usertables.sql REM Author : sai REM Description : TABLE DETAIL view REM ---------------------------------------------------------------- clear col col COL_TABLE_NAME form a30 head "TABLE_NAME" col COL_TABLESPACE_NAME form a12 head "TABLESPACE" col COL_NUM_ROWS form 99999999 head "NUM_ROWS" col COL_LAST_ANALYZED form a10 head "LAST_ANALYZED" col COL_INITIAL_EXTENT form 999999999 head "INITIAL|EXTENT" col COL_NEXT_EXTENT form 999999999 head "NEXT|EXTENT" col COL_MIN_EXTENTS form 999 head "MIN|EXTENTS" col COL_MAX_EXTENTS form 9999999999 head "MAX|EXTENTS" col COL_PCT_INCREASE form 999 head "PCT|INCREASE" col COL_FREELISTS form 999 head "FREELISTS" col COL_FREELIST_GROUPS form 999 head "FREELIST|GROUPS" col USERNAME new_value COL_USERNAME col NOWTIME new_value COL_NOWTIME set termout off SELECT to_char(SYSDATE,'yyyy/mm/dd hh24:mi:ss') NOWTIME FROM DUAL / SELECT USERNAME FROM USER_USERS / set termout on prompt prompt ******************************* TABLE LIST DETAIL VIEW ********************************* prompt prompt USER: &COL_USERNAME TIME: &COL_NOWTIME prompt REM set pause on REM set pause 'Please enter the key' SELECT TABLE_NAME COL_TABLE_NAME, TABLESPACE_NAME COL_TABLESPACE_NAME, NUM_ROWS COL_NUM_ROWS, INITIAL_EXTENT COL_INITIAL_EXTENT, NEXT_EXTENT COL_NEXT_EXTENT, MIN_EXTENTS COL_MIN_EXTENTS, MAX_EXTENTS COL_MAX_EXTENTS, PCT_INCREASE COL_PCT_INCREASE, FREELISTS COL_FREELISTS, FREELIST_GROUPS COL_FREELIST_GROUPS, LAST_ANALYZED COL_LAST_ANALYZED FROM USER_TABLES ORDER BY TABLE_NAME / prompt prompt *************************** TABLE LIST DETAIL VIEW END ***************************** prompt clear col set pause off set pages 20 set linesize 80 set verify on set feedback on set echo on
-- 客户表 create table customer ( id serial primary key auto_increment comment '自增主键', name varchar(100) comment '姓名', gender varchar(20) comment '性别', age int comment '年龄' ) engine = InnoDB default charset utf8mb4; -- 商品表 create table commodity ( id serial primary key auto_increment comment '自增主键', name varchar(100) comment '名称', price decimal comment '价格', produce_city varchar(100) comment '产地' ) engine = InnoDB default charset utf8mb4; -- 账户表 create table account ( id serial primary key auto_increment comment '自增主键', name varchar(100) comment '姓名', age int comment '年龄', balance decimal comment '余额' ) engine = InnoDB default charset utf8mb4;
<gh_stars>0 select count(*) as CNT from test_seller_type_dim
-- Table: public.environmentvariable -- DROP TABLE IF EXISTS public.environmentvariable; CREATE TABLE IF NOT EXISTS public.environmentvariable ( key character varying COLLATE pg_catalog."default" NOT NULL, value character varying COLLATE pg_catalog."default" NOT NULL, type character varying COLLATE pg_catalog."default" NOT NULL, createdon timestamp with time zone, modifiedon timestamp with time zone, createdby character varying COLLATE pg_catalog."default", modifiedby character varying COLLATE pg_catalog."default", isactive boolean NOT NULL, comments character varying COLLATE pg_catalog."default", userid bigint NOT NULL, environmentid bigint, content character varying COLLATE pg_catalog."default", id bigint NOT NULL DEFAULT id_generator(), CONSTRAINT environmentvariable_pkey PRIMARY KEY (id), CONSTRAINT environmentvariable_userid_fkey FOREIGN KEY (userid) REFERENCES public.customer (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.environmentvariable OWNER to "cana-api"; -- Index: fki_environmentvariable_environmentid_pkey -- DROP INDEX IF EXISTS public.fki_environmentvariable_environmentid_pkey; CREATE INDEX IF NOT EXISTS fki_environmentvariable_environmentid_pkey ON public.environmentvariable USING btree (environmentid ASC NULLS LAST) TABLESPACE pg_default; -- Index: index_userid -- DROP INDEX IF EXISTS public.index_userid; CREATE INDEX IF NOT EXISTS index_userid ON public.environmentvariable USING btree (userid ASC NULLS LAST) TABLESPACE pg_default;
<reponame>w0xter/morph-csv-demo DROP TABLE IF EXISTS "calendar" CASCADE; CREATE TABLE calendar(service_id VARCHAR,PRIMARY KEY (service_id)); DROP TABLE IF EXISTS "calendar_dates" CASCADE; CREATE TABLE calendar_dates(service_id VARCHAR,PRIMARY KEY (service_id)); DROP TABLE IF EXISTS "routes" CASCADE; CREATE TABLE routes(route_id VARCHAR,route_short_name VARCHAR,route_desc VARCHAR,PRIMARY KEY (route_id)); DROP TABLE IF EXISTS "stop_times" CASCADE; CREATE TABLE stop_times(trip_id VARCHAR,arrival_time VARCHAR,stop_id VARCHAR,PRIMARY KEY (arrival_time,stop_id,trip_id)); DROP TABLE IF EXISTS "stops" CASCADE; CREATE TABLE stops(stop_id VARCHAR,stop_desc VARCHAR,PRIMARY KEY (stop_id)); DROP TABLE IF EXISTS "trips" CASCADE; CREATE TABLE trips(route_id VARCHAR,service_id VARCHAR,trip_id VARCHAR,trip_short_name VARCHAR,PRIMARY KEY (trip_id));
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 15, 2019 at 05:32 PM -- Server version: 10.1.40-MariaDB -- PHP Version: 7.3.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; 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 utf8mb4 */; -- -- Database: `project` -- -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `firstname` varchar(50) NOT NULL, `surname` varchar(50) NOT NULL, `username` varchar(50) NOT NULL, `email` varchar(100) NOT NULL, `phone` varchar(16) NOT NULL, `password` varchar(50) NOT NULL, `vkey` varchar(50) NOT NULL, `verified` tinyint(1) DEFAULT '0', `reg_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `firstname`, `surname`, `username`, `email`, `phone`, `password`, `vkey`, `verified`, `reg_date`) VALUES (1, 'Admin', 'Demo', 'admin', '<EMAIL>', '08099575767', '<PASSWORD>a801fc3', '647489df1b96829e202085c8b86271ba', 1, '2019-06-10 22:01:26'), (2, 'Admin', 'Demo', '12345678', '<EMAIL>', '08099575767', '202cb962ac59075b964b07152d234b70', 'b3cdbdbfc072f9041f9c986a6b3e6d2b', 0, '2019-06-12 10:47:52'), (3, 'AMINU', 'MM', 'aminu', '<EMAIL>', '08099575767', 'e10adc3949ba59abbe56e057f20f883e', 'fddd5a5fb1407f7f2e84885a34793639', 0, '2019-06-12 10:57:50'), (4, 'AMINU', 'MM', 'demodemo', '<EMAIL>', '08099575767', '202cb962ac59075b964b07152d234b70', '99521155f8c0fab158a43128182d9b7a', 0, '2019-06-12 11:14:25'), (5, 'AMINU', 'MM', 'bbbbbb', '<EMAIL>', '08099575767', '202cb962ac59075b964b07152d234b70', '58b47c59ee15c164bd7c7b228af4c8f0', 0, '2019-06-12 12:47:02'), (6, 'AMINU', 'MM', 'bbbbbb', '<EMAIL>', '08099575767', '202cb962ac59075b964b07152d234b70', '0743077826e2568680d29b5819d2f52b', 0, '2019-06-12 12:49:27'), (7, 'AMINU', 'MM', 'bbbbbb', '<EMAIL>', '08099575767', '202cb962ac59075b964b07152d234b70', '50d38584177a6e6bd0841f8d32dfa390', 0, '2019-06-12 12:53:22'), (8, 'AMINU', 'MM', 'bbbbbb', '<EMAIL>', '08099575767', '202cb962ac59075b964b07152d234b70', '0d2007ce70a17c526c47880fc120bffe', 0, '2019-06-12 12:54:29'), (9, 'AMINU', 'MM', 'bbbbbb', '<EMAIL>', '08099575767', '202cb962ac59075b964b07152d234b70', 'd7094e33ffac2af2ee14910c817b51a5', 0, '2019-06-12 17:51:56'); -- -- Indexes for dumped tables -- -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; COMMIT; /*!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 */;
<filename>imooc-c2-local-tran-sql/mysql-transaction.sql -- 查看全局和当前session的事务隔离级别 SELECT @@GLOBAL.tx_isolation, @@tx_isolation; -- 设置隔离级别 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED -- level: READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE -- session 1: START TRANSACTION; UPDATE t_user SET amount = amount + 100 WHERE username = 'BatMan'; UPDATE t_user SET amount = amount - 100 WHERE username = 'SuperMan'; COMMIT; -- ROLLBACK; -- session 2: START TRANSACTION; SELECT * FROM t_user COMMIT;
IF OBJECT_ID('inventory.get_account_id_by_shipper_id') IS NOT NULL DROP FUNCTION inventory.get_account_id_by_shipper_id; GO CREATE FUNCTION inventory.get_account_id_by_shipper_id(@shipper_id integer) RETURNS integer AS BEGIN RETURN ( SELECT inventory.shippers.account_id FROM inventory.shippers WHERE inventory.shippers.shipper_id=@shipper_id AND inventory.shippers.deleted = 0 ); END; GO
<reponame>UAMS-DBMI/PosdaTools<gh_stars>1-10 -- Name: FindSeriesInCollectionWhichAreNotInActivity -- Schema: posda_files -- Columns: ['series_instance_uid', 'dicom_file_type', 'modality', 'visibility', 'num_files'] -- Args: ['collection', 'activity_id'] -- Tags: [] -- Description: Find all series which are in specified collection, but not in the timepoint -- select series_instance_uid, dicom_file_type, modality, coalesce(visibility, 'visible') as visibility, count(distinct file_id) as num_files from file_series natural join dicom_file natural join ctp_file where series_instance_uid in ( select distinct series_instance_uid from file_series natural join ctp_file where project_name = ? ) and series_instance_uid not in ( select distinct series_instance_uid from file_series natural join activity_timepoint_file where activity_timepoint_id = ( select max (activity_timepoint_id) as activity_timepoint_id from activity_timepoint where activity_id = ? ) ) group by series_instance_uid, dicom_file_type, modality, visibility
<reponame>TTGS/IT_script<gh_stars>0 CREATE OR REPLACE FUNCTION public.check_china_id_reason(id text) RETURNS text LANGUAGE plpgsql AS $function$ DECLARE -- 我自己的参数 p_id text:=id; ck_bool boolean:=null; ck_step text:=null; ck_len int:=null; ck_text boolean:=null; ck_date date:=null; p_steen text:=null; p_eteen text:=null; p_sum numeric :=null; s_eteen text:=null; -- 系统异常捕获 sys_RETURNED_SQLSTATE text:=null; sys_COLUMN_NAME text:=null; sys_CONSTRAINT_NAME text:=null; sys_PG_DATATYPE_NAME text:=null; sys_MESSAGE_TEXT text:=null; sys_TABLE_NAME text:=null; sys_SCHEMA_NAME text:=null; sys_PG_EXCEPTION_DETAIL text:=null; sys_PG_EXCEPTION_HINT text:=null; sys_PG_EXCEPTION_CONTEXT text:=null; begin -- 长度检查 ck_step:='to check length(L1)'; select length(p_id) into ck_len; ck_step:='I have ck_len(L2)'; if ck_len>18 then ck_step:='I will false(L3)'; return 'too long'; elsif ck_len<18 then ck_step:='I will false(L3)'; return 'too small'; end if ; ck_step:='the check pass(L4)'; /* * \d=[0-9] * \d{17}=[0-9]写了17次 * (\d|x)=最后一位是0到9的数字或者x * ~* 正则表达式,大小写不敏感 * */ -- 检查内容是否为数字,最后一位为x或者数字。注意这里x大小写不敏感。 ck_step:='to check text (N1)'; SELECT p_id ~* '\d{17}(\d|x)' into ck_text; ck_step:='I have ck_text(N2)'; if ck_text=false then ck_step:='I will false(N3)'; return 'not numeric or x'; end if ; ck_step:='I will false(N3)'; -- 地区检查 ----------------------------------------- -- 没有数据,只是检查1前6位是否为数字。 -- -- 不过感觉这个有点多此一举, -- -- 因为如果有非数字进来,前面的检查就拦截了。 -- -- 不会轮到这里再检查。 -- ----------------------------------------- ck_step:='I have entered the block (B2)'; select case when substring(p_id,1,6) ~* '\d{6}' then true else false end into ck_bool ; if ck_bool is false then return 'the area is not number'; end if ; -- 生日检查 ck_step:='to check 8 postion (B1)'; BEGIN ck_step:='I have entered the block (B2)'; select substring(p_id,7,8)::date into ck_date; ck_step:='the pass for date check(B3)'; exception WHEN SQLSTATE '22008' then ck_step:='I will false(B4)'; return 'birthday error'; END; ck_step:='the pass date check(B5)'; -- 最后一位校验位检查 -- 17 位求和 ck_step:='to find 17 postion (P1)'; p_steen:=substring(p_id,1,17); ck_step:='I have 17 postion (P2)'; -- 前17位乘以系数 ck_step:='17 postion × system number (P3)'; select sum(substring(o.id,i,1)::int *v) into p_sum from ( values( p_id ) ) as o(id) cross join (values (1,7) ,(2,9) ,(3,10),(4,5) ,(5,8) ,(6,4) ,(7,2) ,(8,1) ,(9,6) ,(10,3),(11,7),(12,9) ,(13,10),(14,5),(15,8),(16,4),(17,2) ) as r(i,v) ; ck_step:='I have summed (P4)'; -- 18 位 ck_step:='to find num 18 (F1)'; p_eteen:=substring(p_id,18,1); ck_step:='found num 18 (F2)'; -- 找到正确余数 ck_step:='to found real our NUM 18 (F3)'; select cz_checknum into s_eteen from (values(1,0,'1'),(2,1,'0'),(3,2,'x'),(4,3,'9'),(5,4,'8'),(6,5,'7') ,(7,6,'6'),(8,7,'5'),(9,8,'4'),(10,9,'3'),(11,10,'2')) cz(cz_id,cz_mod,cz_checknum) -- 求出余数 where cz_mod=mod(p_sum,11); ck_step:='NUM 18 was found (F4)'; ck_step:='to check 18 and 18 (E1)'; -- 检查最后一位是不是对的。 if upper(s_eteen)<> upper(p_eteen) then return 'check num error'; end if ; ck_step:='18 and 18 is pass (E2)'; ck_step:='the end of the wolrd (done)'; return 'true'; exception WHEN others then GET STACKED DIAGNOSTICS sys_RETURNED_SQLSTATE =RETURNED_SQLSTATE , sys_COLUMN_NAME =COLUMN_NAME , sys_CONSTRAINT_NAME =CONSTRAINT_NAME, sys_PG_DATATYPE_NAME =PG_DATATYPE_NAME, sys_MESSAGE_TEXT =MESSAGE_TEXT , sys_TABLE_NAME =TABLE_NAME , sys_SCHEMA_NAME =SCHEMA_NAME , sys_PG_EXCEPTION_DETAIL =PG_EXCEPTION_DETAIL, sys_PG_EXCEPTION_HINT =PG_EXCEPTION_HINT, sys_PG_EXCEPTION_CONTEXT=PG_EXCEPTION_CONTEXT; RAISE NOTICE '==========caught EXCEPTION start(%)==========',now() ; RAISE NOTICE '========== SYS exception =========='; RAISE NOTICE 'sys_RETURNED_SQLSTATE:%', sys_RETURNED_SQLSTATE; RAISE NOTICE 'sys_COLUMN_NAME:%', sys_COLUMN_NAME ; RAISE NOTICE 'sys_CONSTRAINT_NAME:%', sys_CONSTRAINT_NAME ; RAISE NOTICE 'sys_PG_DATATYPE_NAME:%', sys_PG_DATATYPE_NAME ; RAISE NOTICE 'sys_MESSAGE_TEXT:%', sys_MESSAGE_TEXT ; RAISE NOTICE 'sys_TABLE_NAME:%', sys_TABLE_NAME ; RAISE NOTICE 'sys_SCHEMA_NAME:%', sys_SCHEMA_NAME ; RAISE NOTICE 'sys_PG_EXCEPTION_DETAIL:%', sys_PG_EXCEPTION_DETAIL ; RAISE NOTICE 'sys_PG_EXCEPTION_HINT:%', sys_PG_EXCEPTION_HINT ; RAISE NOTICE 'sys_PG_EXCEPTION_CONTEXT:%', sys_PG_EXCEPTION_CONTEXT; RAISE NOTICE '========== my exception =========='; RAISE NOTICE 'p_id:%',p_id; RAISE NOTICE 'ck_step:%',ck_step; RAISE NOTICE 'ck_len:%',ck_len; RAISE NOTICE 'ck_text:%',ck_text; RAISE NOTICE 'ck_date:%',ck_date; RAISE NOTICE 'p_steen:%',p_steen; RAISE NOTICE 'p_eteen:%',p_eteen; RAISE NOTICE 'p_sum:%',p_sum; RAISE NOTICE 's_eteen:%',s_eteen; RAISE NOTICE '==========caught EXCEPTION end ===============' ; RETURN NULL; END; $function$ ;
<gh_stars>10-100 SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [Profile.Data].[Publication.Pubmed.AddPubMedXMLBatch] @Data xml AS BEGIN create table #tmpPubs (pmid int primary key, Filename varchar(50), x xml) insert into #tmpPubs (pmid, Filename, x) select t.x.value('@PMID', 'int') as PMID, t.x.value('@Filename', 'varchar(50)') as PMCCitations, t.x.query('PubmedArticle') as x from @data.nodes('/Publications/Publication') t(x) delete from [Profile.Data].[Publication.PubMed.AllXML] where pmid in (select pmid from #tmpPubs) insert into [Profile.Data].[Publication.PubMed.AllXML] (pmid, x, filename) select pmid, x, filename from #tmpPubs END GO
<gh_stars>0 -- @testpoint:opengauss关键字group(保留),作为存储过程名 --关键字不带引号-合理报错 create or replace procedure group() is V1 BLOB; begin IF V1 is NULL then raise info 'V1 is NULL'; else raise info 'V1 is not NULL'; end if; end; / --关键字带双引号-成功 create or replace procedure "group"() is V1 BLOB; begin IF V1 is NULL then raise info 'V1 is NULL'; else raise info 'V1 is not NULL'; end if; end; / --清理环境 drop procedure "group"; --关键字带单引号-合理报错 create or replace procedure 'group'() is V1 BLOB; begin IF V1 is NULL then raise info 'V1 is NULL'; else raise info 'V1 is not NULL'; end if; end; / --关键字带反引号-合理报错 create or replace procedure `group`() is V1 BLOB; begin IF V1 is NULL then raise info 'V1 is NULL'; else raise info 'V1 is not NULL'; end if; end; /
-- @testpoint:opengauss关键字sqlstate(非保留),作为表空间名 --关键字不带引号,创建成功 drop tablespace if exists sqlstate; CREATE TABLESPACE sqlstate RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1'; drop tablespace sqlstate; --关键字带双引号,创建成功 drop tablespace if exists "sqlstate"; CREATE TABLESPACE "sqlstate" RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1'; drop tablespace "sqlstate"; --关键字带单引号,合理报错 drop tablespace if exists 'sqlstate'; CREATE TABLESPACE 'sqlstate' RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1'; --关键字带反引号,合理报错 drop tablespace if exists `sqlstate`; CREATE TABLESPACE `sqlstate` RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
-- @testpoint: opengauss关键字mapping(非保留),作为函数名,部分测试点合理报错 --关键字不带引号-成功 drop function if exists mapping; create function mapping(i integer) returns integer as $$ begin return i+1; end; $$ language plpgsql; / --关键字带双引号-成功 drop function if exists "mapping"; create function "mapping"(i integer) returns integer as $$ begin return i+1; end; $$ language plpgsql; / --关键字带单引号-合理报错 drop function if exists 'mapping'; create function 'mapping'(i integer) returns integer as $$ begin return i+1; end; $$ language plpgsql; / --关键字带反引号-合理报错 drop function if exists `mapping`; create function `mapping`(i integer) returns integer as $$ begin return i+1; end; $$ language plpgsql; / --清理环境 drop function if exists mapping(integer); drop function if exists "mapping"(integer);
-- phpMyAdmin SQL Dump -- version 5.1.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 19, 2021 at 04:56 PM -- Server version: 10.4.21-MariaDB -- PHP Version: 8.0.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; 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 utf8mb4 */; -- -- Database: `ticketing-system` -- -- -------------------------------------------------------- -- -- Table structure for table `events` -- CREATE TABLE `events` ( `id` int(10) UNSIGNED NOT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `start_time` datetime NOT NULL, `venue` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `price_VIP` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `price_regular` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `attendees` int(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `events` -- INSERT INTO `events` (`id`, `title`, `description`, `start_time`, `venue`, `created_at`, `updated_at`, `deleted_at`, `price_VIP`, `price_regular`, `attendees`) VALUES (18, 'Church Hill Nairobi', 'Churchill Comedy Extravaganza', '2021-12-07 00:00:00', 'Carnivore', NULL, NULL, NULL, 'Kshs 10,000', 'Kshs 4,000', 1000), (20, 'Church Hill Ngong', 'Wind Mills Edition', '2021-12-10 00:00:00', 'Ngog Stadium', NULL, NULL, NULL, 'Kshs 20,000', 'Kshs 10,000', 1000); -- -------------------------------------------------------- -- -- Table structure for table `failed_jobs` -- CREATE TABLE `failed_jobs` ( `id` bigint(20) UNSIGNED NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2019_08_19_000000_create_failed_jobs_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `tickets` -- CREATE TABLE `tickets` ( `id` int(11) NOT NULL, `title` varchar(255) NOT NULL, `msg` text NOT NULL, `email` varchar(255) NOT NULL, `created` datetime NOT NULL DEFAULT current_timestamp(), `status` enum('open','closed','resolved') NOT NULL DEFAULT 'open' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `userevents` -- CREATE TABLE `userevents` ( `id` int(6) UNSIGNED NOT NULL, `firstname` varchar(30) NOT NULL, `lastname` varchar(30) NOT NULL, `email` varchar(50) DEFAULT NULL, `title` varchar(30) NOT NULL, `ticket_type` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `userevents` -- INSERT INTO `userevents` (`id`, `firstname`, `lastname`, `email`, `title`, `ticket_type`) VALUES (1, 'Naomi', 'Kamweru', '<EMAIL>', 'vgfdg', 'VIP for Kshs 10,000'), (2, 'Lynne', 'Mwangi', '<EMAIL>', 'vgfdg', 'VIP for Kshs 10,000'), (3, 'Naomi', 'Kamweru', '<EMAIL>', 'vgfdg', 'VIP for Kshs 10,000'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Indexes for dumped tables -- -- -- Indexes for table `events` -- ALTER TABLE `events` ADD PRIMARY KEY (`id`), ADD KEY `events_deleted_at_index` (`deleted_at`); -- -- Indexes for table `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `tickets` -- ALTER TABLE `tickets` ADD PRIMARY KEY (`id`); -- -- Indexes for table `userevents` -- ALTER TABLE `userevents` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `events` -- ALTER TABLE `events` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; -- -- AUTO_INCREMENT for table `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `tickets` -- ALTER TABLE `tickets` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `userevents` -- ALTER TABLE `userevents` MODIFY `id` int(6) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; COMMIT; /*!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 */;
<gh_stars>0 INSERT INTO t_nilai_ijz (mapel_id, santri_id, tahun_id, nrp) SELECT n.`mapel_id`, n.`santri_id`, 3 AS tahun_id, ROUND(AVG(n.`nrp`),0) AS r_rpt FROM t_na n JOIN m_santri s ON s.`id_santri` = n.`santri_id` WHERE n.`mapel_id` IN (SELECT m.`id_mapel` FROM t_urutmapel u JOIN m_mapel m ON u.`mapel_id` = m.`id_mapel` WHERE u.`urut_ijz` IS NOT NULL) AND s.`id_santri` IN (SELECT s.`id_santri` FROM t_agtkelas a JOIN m_santri s ON a.`santri_id` = s.`id_santri` JOIN m_kelas k ON k.`id_kelas` = a.`kelas_id` WHERE a.`tahun_id` = 3 && k.`rombel` = 6) GROUP BY n.`santri_id`, n.`mapel_id`
<gh_stars>0 -- Affichage de la table personne par le titre "Melle" puis "Mme" puis "Mr" SELECT * FROM Personne ORDER BY Titre ASC
<filename>scripts/script-teatro.sql -- ----------------------------------------------------- -- Schema mydb -- ----------------------------------------------------- CREATE DATABASE IF NOT EXISTS `teatro_bd` DEFAULT CHARACTER SET utf8 ; USE `teatro_bd` ; -- ----------------------------------------------------- -- Table `mydb`.`cliente` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `cliente` ( `cod_cliente` INT NOT NULL, `nome_cliente` VARCHAR(200) NOT NULL, `cpf_cliente` VARCHAR(14) NOT NULL, `email_cliente` VARCHAR(100) NOT NULL, `senha_cliente` VARCHAR(20) NOT NULL, `data_hora` DATETIME NOT NULL, PRIMARY KEY (`cod_cliente`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`evento` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `evento` ( `cod_evento` INT NOT NULL, `nome_evento` VARCHAR(100) NOT NULL, `data_hora_evento` DATETIME NOT NULL, `nome_responsavel` VARCHAR(100) NOT NULL, `qtd_max` INT NOT NULL, `qtd_min` INT NOT NULL, PRIMARY KEY (`cod_evento`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`ingresso` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `ingresso` ( `cod_ingresso` INT NOT NULL, `tipo_ingresso` VARCHAR(50) NOT NULL, `valor_ingresso` DECIMAL(10,2) NOT NULL, `numero_cadeira` VARCHAR(10) NOT NULL, `data_hora` DATETIME NOT NULL, `cod_evento` INT NOT NULL, PRIMARY KEY (`cod_ingresso`), INDEX `fk_evento` (`cod_evento` ASC), CONSTRAINT `fk_ingresso_evento1` FOREIGN KEY (`cod_evento`) REFERENCES `evento` (`cod_evento`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`pagamento` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `pagamento` ( `cod_cliente` INT NOT NULL, `cod_ingresso` INT NOT NULL , `valor_total` DECIMAL(10,2) NOT NULL, `tipo_pagto` VARCHAR(50) NOT NULL, `situacao` VARCHAR(50) NOT NULL, `data_hora` DATETIME NOT NULL, PRIMARY KEY (`cod_cliente`, `cod_ingresso`), INDEX `fk_ingresso` (`cod_ingresso` ASC), INDEX `fk_cliente` (`cod_cliente` ASC), CONSTRAINT `fk_cliente_has_ingresso_cliente` FOREIGN KEY (`cod_cliente`) REFERENCES `cliente` (`cod_cliente`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_cliente_has_ingresso_ingresso1` FOREIGN KEY (`cod_ingresso`) REFERENCES `ingresso` (`cod_ingresso`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- DML (data manipulation language): -- INSERIR DADOS: INSERT INTO cliente (cod_cliente, nome_cliente, cpf_cliente, email_cliente, senha_cliente, data_hora) VALUES (1, 'Fabio', '893.342.311-99', '<EMAIL>', md5('123456'), now()), (2, 'Maria', '437.743.742-99', '<EMAIL>', md5('maria123'), now()), (3, 'José', '643.742.473-83', '<EMAIL>', md5('zeze0800'), now()); select * from cliente; insert into evento (cod_evento, nome_evento, data_hora_evento, nome_responsavel, qtd_max, qtd_min) VALUES (1, 'Orquestra Sinfônica', '2020-04-02 19:00', 'Adriano dos Anjos', 1000, 100), (2, 'Standup do Lucas', '2020-04-07 21:00', 'Miller', 2000, 50); select * from evento; insert into ingresso (cod_ingresso, tipo_ingresso, valor_ingresso, numero_cadeira, data_hora, cod_evento) VALUES (1, 'Inteira', 90.00, 'A1', now(), 1), (2, 'Inteira', 90.00, 'A2', now(), 1), (3, 'Meia', 45.00, 'A3', now(), 1), (4, 'Meia', 45.00, 'A4', now(), 1), (5, 'Inteira', 50.00, 'A1', now(), 2), (6, 'Inteira', 50.00, 'A2', now(), 2), (7, 'Meia', 25.00, 'A3', now(), 2), (8, 'Meia', 25.00, 'A4', now(), 2); select * from ingresso; insert into pagamento (cod_cliente, cod_ingresso, valor_total, tipo_pagto, situacao, data_hora) values (1, 1, 90, 'Boleto', 'Aguardando', now()), (1, 2, 90, 'Crédito', 'Aguardando', now()), (1, 2, 90, 'Boleto', 'Aguardando', now()); select * from pagamento;
<reponame>qoneqo/lawencon_inventory -- phpMyAdmin SQL Dump -- version 5.1.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Aug 25, 2021 at 05:23 PM -- Server version: 10.6.3-MariaDB -- PHP Version: 7.2.34 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; 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 utf8mb4 */; -- -- Database: `db_lawencon` -- -- -------------------------------------------------------- -- -- Table structure for table `produk` -- CREATE TABLE `produk` ( `Id` int(10) NOT NULL, `Nama_barang` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `Kode_barang` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `Jumlah_barang` int(10) NOT NULL, `Tanggal` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `produk` -- INSERT INTO `produk` (`Id`, `Nama_barang`, `Kode_barang`, `Jumlah_barang`, `Tanggal`) VALUES (4, '<NAME>', 'ASD123', 80, '2021-08-25'), (5, '<NAME>', 'SPI123', 20, '2021-08-27'), (6, 'Kertas HVS', 'KVS213', 123, '2021-08-26'); -- -- Indexes for dumped tables -- -- -- Indexes for table `produk` -- ALTER TABLE `produk` ADD PRIMARY KEY (`Id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `produk` -- ALTER TABLE `produk` MODIFY `Id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; COMMIT; /*!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 */;
<reponame>Ewertton/prfight -- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Feb 26, 2017 at 02:36 AM -- Server version: 10.1.21-MariaDB -- PHP Version: 5.6.30 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 utf8mb4 */; -- -- Database: `databaseprfight` -- -- -------------------------------------------------------- -- -- Table structure for table `login_attempts` -- CREATE TABLE `login_attempts` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `created_alt` timestamp NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `recoveries` -- CREATE TABLE `recoveries` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `token` varchar(255) NOT NULL, `status` int(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `idroles` int(11) NOT NULL, `role` varchar(45) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `roles` -- INSERT INTO `roles` (`idroles`, `role`) VALUES (1, 'user'), (2, 'administrator'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `name` varchar(100) NOT NULL, `cpf` int(11) NOT NULL, `faixa` varchar(45) DEFAULT NULL, `username` varchar(45) NOT NULL, `password` varchar(256) NOT NULL, `email` varchar(100) NOT NULL, `salt` varchar(256) NOT NULL, `status` int(1) NOT NULL DEFAULT '1', `descricao` varchar(500) DEFAULT NULL, `roles_id` int(11) DEFAULT NULL, `image` varchar(250) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `cpf`, `faixa`, `username`, `password`, `email`, `salt`, `status`, `descricao`, `roles_id`, `image`) VALUES (1, 'ewertton', 0, 'Branca 7 Kyu', 'ewertton', '<PASSWORD>', '<EMAIL>', '<PASSWORD>', 1, ' ', 2, '<PASSWORD>620aab9b1792cbcf75f860.png'), (2, 'klaytton', 0, 'Branca 7 Kyu', 'klaytton', '<KEY>', '<EMAIL>', '<PASSWORD>8<PASSWORD>', 1, ' ', 1, ''); -- -- Indexes for dumped tables -- -- -- Indexes for table `login_attempts` -- ALTER TABLE `login_attempts` ADD PRIMARY KEY (`id`,`user_id`), ADD KEY `fk_login_attempts_id_user_idx` (`user_id`); -- -- Indexes for table `recoveries` -- ALTER TABLE `recoveries` ADD PRIMARY KEY (`id`,`user_id`), ADD KEY `passwords_id_user_idx` (`user_id`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`idroles`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD KEY `alunos_role_id_idx` (`roles_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `login_attempts` -- ALTER TABLE `login_attempts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `recoveries` -- ALTER TABLE `recoveries` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `roles` -- ALTER TABLE `roles` MODIFY `idroles` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- Constraints for dumped tables -- -- -- Constraints for table `login_attempts` -- ALTER TABLE `login_attempts` ADD CONSTRAINT `fk_login_attempts_id_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints for table `recoveries` -- ALTER TABLE `recoveries` ADD CONSTRAINT `recoveries_id_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints for table `users` -- ALTER TABLE `users` ADD CONSTRAINT `users_roles_id` FOREIGN KEY (`roles_id`) REFERENCES `roles` (`idroles`) 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 */;
<reponame>ThilineTissera/PAF-assignment /* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50505 Source Host : localhost:3306 Source Database : pos Target Server Type : MYSQL Target Server Version : 50505 File Encoding : 65001 Date: 2019-05-25 22:23:18 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `supplier` -- ---------------------------- DROP TABLE IF EXISTS `supplier`; CREATE TABLE `supplier` ( `Id` int(11) NOT NULL, `name` varchar(30) NOT NULL, `Contact No` varchar(30) NOT NULL, `Type` varchar(30) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- ---------------------------- -- Records of supplier -- ---------------------------- INSERT INTO `supplier` VALUES ('1', 'Deneth ', '1234567890', 'shirts'); INSERT INTO `supplier` VALUES ('2', 'kushi', '1234567995', 'Trousers'); INSERT INTO `supplier` VALUES ('3', 'chamika', '2134568789', 'frocks'); INSERT INTO `supplier` VALUES ('4', 'anjana', '7894561123', 'hats'); INSERT INTO `supplier` VALUES ('5', 'perera', '4567891230', 'shocks');
-- phpMyAdmin SQL Dump -- version 5.1.1 -- https://www.phpmyadmin.net/ -- -- Servidor: 1172.16.31.10 -- Tiempo de generación: 23-03-2022 a las 04:50:05 -- Versión del servidor: 10.4.22-MariaDB -- Versión de PHP: 8.0.13 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; 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 utf8mb4 */; -- -- Base de datos: `documentos` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `asistente` -- CREATE TABLE `asistente` ( `id` int(11) NOT NULL, `userId` int(11) DEFAULT NULL, `directorId` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `asistente` -- INSERT INTO `asistente` (`id`, `userId`, `directorId`) VALUES (1, 3, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `compartido` -- CREATE TABLE `compartido` ( `id` int(11) NOT NULL, `userId` int(11) DEFAULT NULL, `documentoId` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `director` -- CREATE TABLE `director` ( `id` int(11) NOT NULL, `userId` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `director` -- INSERT INTO `director` (`id`, `userId`) VALUES (1, 2); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `documento` -- CREATE TABLE `documento` ( `id` int(11) NOT NULL, `titulo` varchar(255) NOT NULL, `descripcion` varchar(255) NOT NULL, `fecha` varchar(255) NOT NULL, `tipoDocumentoId` int(11) DEFAULT NULL, `userId` int(11) DEFAULT NULL, `compartida` tinyint(4) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `notificacione` -- CREATE TABLE `notificacione` ( `id` int(11) NOT NULL, `titulo` varchar(255) NOT NULL, `descripcion` varchar(255) NOT NULL, `fecha` varchar(255) NOT NULL, `estado` tinyint(4) NOT NULL DEFAULT 0, `userId` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `role` -- CREATE TABLE `role` ( `id` int(11) NOT NULL, `name` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `role` -- INSERT INTO `role` (`id`, `name`) VALUES (4, 'admin'), (5, 'director'), (6, 'asistente'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tipo_documento` -- CREATE TABLE `tipo_documento` ( `id` int(11) NOT NULL, `nombre` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `tipo_documento` -- INSERT INTO `tipo_documento` (`id`, `nombre`) VALUES (1, 'OFICIO'), (2, 'CARTA'), (3, 'CIRCULAR'), (4, 'MEMORANDUN'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `user` -- CREATE TABLE `user` ( `id` int(11) NOT NULL, `roleId` int(11) DEFAULT NULL, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `user` -- INSERT INTO `user` (`id`, `roleId`, `name`, `email`, `password`) VALUES (1, 4, '<NAME>', '<EMAIL>', '$2b$10$fzIcxqHb2weRYGn4/ABRx.0uQvKeiCSnOtNC9PEkQGpjUKgIOTgqu'), (2, 5, '<NAME>', '<EMAIL>', '$2b$10$He.gBxJrLNLNWjzBX1Sqw.3AjIlel3uYrUrqaczkrV4C6v7KgggGe'), (3, 6, '<NAME>', '<EMAIL>', '$2b$10$Ka5SwdciDIN4f3cLOo.XPurnQIgMEYyMFyutXLul9YhEiGThHhYf6'); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `asistente` -- ALTER TABLE `asistente` ADD PRIMARY KEY (`id`), ADD KEY `FK_068b0cda10bcd2fd159e617bbaf` (`userId`), ADD KEY `FK_22ece125d7e963f872efbec44ea` (`directorId`); -- -- Indices de la tabla `compartido` -- ALTER TABLE `compartido` ADD PRIMARY KEY (`id`), ADD KEY `FK_3a2bc976a6fe7e7aeb118d3ad3c` (`userId`), ADD KEY `FK_67b40be034ca54919b6451a5e3c` (`documentoId`); -- -- Indices de la tabla `director` -- ALTER TABLE `director` ADD PRIMARY KEY (`id`), ADD KEY `FK_9d87a9f38f0c210325642591d8a` (`userId`); -- -- Indices de la tabla `documento` -- ALTER TABLE `documento` ADD PRIMARY KEY (`id`), ADD KEY `FK_d63c45d642a4a9b74609f3594a8` (`tipoDocumentoId`), ADD KEY `FK_467b259d33be6c1e5994114b02c` (`userId`); -- -- Indices de la tabla `notificacione` -- ALTER TABLE `notificacione` ADD PRIMARY KEY (`id`), ADD KEY `FK_3caf793430b0c0ca8ff2652ff1b` (`userId`); -- -- Indices de la tabla `role` -- ALTER TABLE `role` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `tipo_documento` -- ALTER TABLE `tipo_documento` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`), ADD KEY `FK_c28e52f758e7bbc53828db92194` (`roleId`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `asistente` -- ALTER TABLE `asistente` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `compartido` -- ALTER TABLE `compartido` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `director` -- ALTER TABLE `director` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `documento` -- ALTER TABLE `documento` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `notificacione` -- ALTER TABLE `notificacione` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `role` -- ALTER TABLE `role` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT de la tabla `tipo_documento` -- ALTER TABLE `tipo_documento` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT de la tabla `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `asistente` -- ALTER TABLE `asistente` ADD CONSTRAINT `FK_068b0cda10bcd2fd159e617bbaf` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `FK_22ece125d7e963f872efbec44ea` FOREIGN KEY (`directorId`) REFERENCES `director` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `compartido` -- ALTER TABLE `compartido` ADD CONSTRAINT `FK_3a2bc976a6fe7e7aeb118d3ad3c` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `FK_67b40be034ca54919b6451a5e3c` FOREIGN KEY (`documentoId`) REFERENCES `documento` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `director` -- ALTER TABLE `director` ADD CONSTRAINT `FK_9d87a9f38f0c210325642591d8a` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `documento` -- ALTER TABLE `documento` ADD CONSTRAINT `FK_467b259d33be6c1e5994114b02c` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `FK_d63c45d642a4a9b74609f3594a8` FOREIGN KEY (`tipoDocumentoId`) REFERENCES `tipo_documento` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `notificacione` -- ALTER TABLE `notificacione` ADD CONSTRAINT `FK_3caf793430b0c0ca8ff2652ff1b` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `user` -- ALTER TABLE `user` ADD CONSTRAINT `FK_c28e52f758e7bbc53828db92194` FOREIGN KEY (`roleId`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; /*!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 */;
<gh_stars>0 DROP TABLE IF EXISTS `test_001`;
<reponame>Arbinuity/markets DROP TABLE IF EXISTS core_settings; CREATE TABLE core_settings ( name VARCHAR(100) NOT NULL, data VARCHAR(250) NOT NULL ); INSERT INTO core_settings (name, data) VALUES ('init_stream', '0'), ('init_markets', '0'), ('base_currency', 'usd'), ('quote_currency', 'usd'), ('market_timeout', '300'), ('market_process_interval', '300000'), ('market_name', 'arbinuity'), ('minor_currency', '100000000'), ('jwt_secret', 'Jsb3rc!rl3lt@lnyt'); DROP TABLE IF EXISTS asset_types; CREATE TABLE asset_types ( id SMALLINT NOT NULL, name VARCHAR(30) NOT NULL, slug VARCHAR(30) NOT NULL, is_currency BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY ("id") ); INSERT INTO asset_types (id, name, slug, is_currency) VALUES (1, 'Fiat currency', 'fiat', TRUE), (2, 'Crypto currency', 'crypto', TRUE), (3, 'Equity', 'equity', FALSE), (4, 'Bond Funds', 'bond', FALSE), (5, 'Bond ETF', 'etf', FALSE); DROP TABLE IF EXISTS sectors; CREATE TABLE sectors ( id SMALLINT NOT NULL, name VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, description TEXT NOT NULL DEFAULT '', PRIMARY KEY ("id") ); INSERT INTO sectors (id, name, slug, description) VALUES (1, 'Basic Materials', 'basic-materials', ''), (2, 'Capital Goods', 'capital-goods', ''), (3, 'Conglomerates', 'conglomerates', ''), (4, 'Consumer Cyclical', 'consumer-cyclical', ''), (5, 'Consumer/Non-Cyclical', 'consumer-non-cyclical', ''), (6, 'Energy', 'energy', ''), (7, 'Financial', 'financial', ''), (8, 'Healthcare', 'healthcare', ''), (9, 'Services', 'services', ''), (10, 'Technology', 'technology', ''), (11, 'Transportation', 'transportation', ''), (12, 'Utilities', 'utilities', ''); DROP TABLE IF EXISTS asset_sectors; CREATE TABLE asset_sectors ( asset_id SMALLINT NOT NULL, sector_id SMALLINT NOT NULL ); DROP TABLE IF EXISTS industries; CREATE TABLE industries ( id SMALLINT NOT NULL, name VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, description TEXT NOT NULL DEFAULT '', PRIMARY KEY ("id") ); INSERT INTO industries (id, name, slug, description) VALUES (1, 'Advertising', 'advertising', ''), (2, 'Aerospace & Defense', 'aerospace-defense', ''), (3, 'Air Courier', 'air-courier', ''), (4, 'Airline', 'airline', ''), (5, 'Apparel/Accessories', 'apparel-accessories', ''), (6, 'Appliance & Tool', 'appliance-tool', ''), (7, 'Audio & Video Equipement', 'audio-video-equipement', ''), (8, 'Auto & Truck Manufacturers', 'auto-truck-manufacturers', ''), (9, 'Auto & Truck Parts', 'auto-truck-parts', ''), (10, 'Beverages (Alcoholic)', 'beverages-alcoholic', ''), (11, 'Beverages (Nonalcoholic)', 'beverages-nonalcoholic', ''), (12, 'Biotechnology & Drugs', 'biotechnology-drugs', ''), (13, 'Broadcasting & Cable TV', 'broadcasting-cable-tv', ''), (14, 'Business Services', 'business-services', ''), (15, 'Casinos & Gaming', 'casinos-gaming', ''), (16, 'Chemical Manufacturing', 'chemical-manufacturing', ''), (17, 'Checmicals - Plastics & Rubber', 'checmicals-plastics-rubber', ''), (18, 'Coal', 'coal', ''), (19, 'Communications Equipment', 'communications-equipment', ''), (20, 'Communications Services', 'communications-services', ''), (21, 'Computer Hardware', 'computer-hardware', ''), (22, 'Computer Networks', 'computer-networks', ''), (23, 'Computer Pripherals', 'computer-pripherals', ''), (24, 'Computer Services', 'computer-services', ''), (25, 'Computer Storage Devices', 'computer-storage-devices', ''), (26, 'Conglomerates', 'conglomerates', ''), (27, 'Constr. & Argic. Machinery', 'constr-argic-machinery', ''), (28, 'Constr. - Supplies & Fixtures', 'constr-supplies-fixtures', ''), (29, 'Construction - Raw Materials', 'construction-raw-materials', ''), (30, 'Construction Services', 'construction-services', ''), (31, 'Consumer Financial Services', 'consumer-financial-services', ''), (32, 'Containers & Packaging', 'containers-packaging', ''), (33, 'Crops', 'crops', ''), (34, 'Electric Utilities', 'electric utilities', ''), (35, 'Eletronic Instr. & Controls', 'eletronic-instr-controls', ''), (36, 'Fabricated Plastic & Rubber', 'fabricated-plastic-rubber', ''), (37, 'Fish/Liveequity', 'fish-liveequity', ''), (38, 'Food Processing', 'food-processing', ''), (39, 'Footwear', 'footwear', ''), (40, 'Forestry & Wood Products', 'forestry-wood-products', ''), (41, 'Funiture & Fixtures', 'funiture-fixtures', ''), (42, 'Gold & Silver', 'gold-silver', ''), (43, 'Healthcare Facilities', 'healthcare-facilities', ''), (44, 'Hotels & Motels', 'hotels-motels', ''), (45, 'Insurance (Accident & Health)', 'insurance-accident-health', ''), (46, 'Insurance (Life)', 'insurance-life', ''), (47, 'Insurance (Miscelleneous)', 'insurance-miscelleneous', ''), (48, 'Insurance (Prop. & Casualty)', 'insurance-prop-casualty', ''), (49, 'Investment Services', 'investment-services', ''), (50, 'Iron & Steel', 'iron-steel', ''), (51, 'Jewelry & Silverware', 'jewelry-silverware', ''), (52, 'Major Drugs', 'major-drugs', ''), (53, 'Medical Equipment & Supllies', 'medical-equipment-supllies', ''), (54, 'Metal Mining', 'metal-mining', ''), (55, 'Misc. Capital Goods', 'misc-capital-goods', ''), (56, 'Misc. Fabricated Products', 'misc-fabricated-products', ''), (57, 'Misc. Financial Services', 'misc-financial-services', ''), (58, 'Misc. Transportation', 'misc-transportation', ''), (59, 'Mobile Homes & RVs', 'mobile-homes-rvs', ''), (60, 'Money Center Banks', 'money-center-banks', ''), (61, 'Motion Pictures', 'motion-pictures', ''), (62, 'Natural Gas Utilities', 'natural-gas-utilities', ''), (63, 'Non-Metallic Mining', 'non-metallic-mining', ''), (64, 'Office Equipment', 'office-equipment', ''), (65, 'Office Supplies', 'office-supplies', ''), (66, 'Oil & Gas - Integrated', 'oil-gas-integrated', ''), (67, 'Oil & Gas Operations', 'oil-gas-operations', ''), (68, 'Oil Well Services & Equipment', 'oil-well-services-equipment', ''), (69, 'Paper & Paper Products', 'paper-paper-products', ''), (70, 'Personal & Household Prods.', 'personal-household-prods.', ''), (71, 'Personal Services', 'personal-services', ''), (72, 'Photography', 'photography', ''), (73, 'Printing & Publishing', 'printing-publishing', ''), (74, 'Printing Services', 'printing-services', ''), (75, 'Railroads', 'railroads', ''), (76, 'Real Estate Operations', 'real-estate-operations', ''), (77, 'Recreational Activities', 'recreational-activities', ''), (78, 'Recreational Products', 'recreational-products', ''), (79, 'Regional Banks', 'regional-banks', ''), (80, 'Rental & Leasing', 'rental-leasing', ''), (81, 'Restaurants', 'restaurants', ''), (82, 'Retail (Apparel)', 'retail-apparel', ''), (83, 'Retail (Catalog & Mail Order)', 'retail-catalog-mail-order', ''), (84, 'Retail (Department & Discount)', 'retail-department-discount', ''), (85, 'Retail (Drugs)', 'retail-drugs', ''), (86, 'Retail (Grocery)', 'retail-grocery', ''), (87, 'Retail (Home Improvement)', 'retail-home improvement', ''), (88, 'Retail (Speciality)', 'retail-speciality', ''), (89, 'Retail (Technology)', 'retail-technology', ''), (90, 'Schools', 'schools', ''), (91, 'Scientific & Technical Instr.', 'scientific-technical-instr', ''), (92, 'Security Systems & Services', 'security-systems-services', ''), (93, 'Semiconductors', 'semiconductors', ''), (94, 'S&Ls/Savings Banks', 's-ls-savings-banks', ''), (95, 'Software & Programming', 'software-programming', ''), (96, 'Textiles - Non Apparel', 'textiles-non-apparel', ''), (97, 'Tires', 'tires', ''), (98, 'Tobacco', 'tobacco', ''), (99, 'Trucking', 'trucking', ''), (100, 'Waste Management Services', 'waste-management-services', ''), (101, 'Water Transportation', 'water-transportation', ''), (102, 'Water Utilities', 'water-utilities', ''); DROP TABLE IF EXISTS asset_industries; CREATE TABLE asset_industries ( asset_id SMALLINT NOT NULL, industry_id SMALLINT NOT NULL ); DROP TABLE IF EXISTS assets; CREATE TABLE assets ( id VARCHAR(30) NOT NULL, name VARCHAR(100) NOT NULL, symbol VARCHAR(10) NOT NULL, type_id DECIMAL(1,0) NOT NULL, is_supported BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY ("id") ); DROP TABLE IF EXISTS asset_infos; CREATE TABLE asset_infos ( asset_id VARCHAR(30) NOT NULL, color VARCHAR(7) DEFAULT '000000', description TEXT NOT NULL, last_update INTEGER NOT NULL ); DROP TABLE IF EXISTS asset_countries; CREATE TABLE asset_countries ( asset_id VARCHAR(30) NOT NULL, country_iso VARCHAR(3) NOT NULL ); DROP TABLE IF EXISTS exchanges; CREATE TABLE exchanges ( slug VARCHAR(25) NOT NULL, name VARCHAR(25) NOT NULL, url_www VARCHAR(155) DEFAULT NULL, url_api VARCHAR(155) DEFAULT NULL, is_active BOOLEAN NOT NULL DEFAULT TRUE, version VARCHAR(13) DEFAULT NULL, timeout DECIMAL(5,0) NOT NULL DEFAULT 2000, rate_limit SMALLINT NOT NULL DEFAULT 2000, PRIMARY KEY ("slug") ); -- [ CRYPTOCURRENCIES ] INSERT INTO exchanges (slug, name, url_www, url_api, is_active, version, timeout, rate_limit) VALUES ('_1broker', '1Broker', 'https://1broker.com', 'https://1broker.com/?c=en/content/api-documentation', FALSE, '2.0.0', 2000, 1), ('_1btcxe', '1BTCXE', 'https://1btcxe.com', 'https://1btcxe.com/api-docs.php', FALSE, NULL, 2000, 1), ('acx', 'ACX', 'https://acx.io', 'https://acx.io/documents/api_v2', FALSE, '2.0.0', 2000, 1), ('allcoin', 'Allcoin', 'https://www.allcoin.com', 'https://www.allcoin.com/About/APIReference', FALSE, '1.0.0', 2000, 1), ('anxpro', 'ANXPro', 'https://anxpro.com', 'http://docs.anxv2.apiary.io', FALSE, '2.0.0', 2000, 1), ('anybits', 'Anybits', 'https://anybits.com', 'https://anybits.com/help/api', FALSE, NULL, 2000, 1), ('bcex', 'BCEX', 'https://www.bcex.top', 'https://www.bcex.top/api_market/market/', FALSE, '1.0.0', 2000, 1), ('bibox', 'Bibox', 'https://www.bibox.com', 'https://github.com/Biboxcom/api_reference/wiki/home_en', FALSE, '1.0.0', 2000, 1), ('binance', 'Binance', 'https://www.binance.com', 'https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md', TRUE, NULL, 2000, 1), ('bit2c', 'Bit2C', 'https://www.bit2c.co.il', 'https://www.bit2c.co.il/home/api', FALSE, NULL, 2000, 1), ('bitbank', 'bitbank', 'https://bitbank.cc', 'https://docs.bitbank.cc/', FALSE, '1.0.0', 2000, 1), ('bitbay', 'BitBay', 'https://bitbay.net', 'https://bitbay.net/public-api', FALSE, NULL, 2000, 1), ('bitfinex', 'Bitfinex', 'https://www.bitfinex.com', 'https://bitfinex.readme.io/v1/docs', FALSE, '1.0.0', 2000, 1), ('bitfinex2', 'Bitfinex v2', 'https://www.bitfinex.com', 'https://bitfinex.readme.io/v2/docs', FALSE, '2.0.0', 2000, 1), ('bitflyer', 'bitFlyer', 'https://bitflyer.jp', 'https://bitflyer.jp/API', FALSE, '1.0.0', 2000, 1), ('bitforex', 'bitForex', 'https://www.bitforex.com', 'https://github.com/bitforexapi/API_Docs/wiki', FALSE, '1.0.0', 2000, 1), ('bithumb', 'Bithumb', 'https://www.bithumb.com', 'https://www.bithumb.com/u1/US127', FALSE, NULL, 2000, 1), ('bitkk', 'bitkk', 'https://www.bitkk.com', 'https://www.bitkk.com/i/developer', FALSE, '1.0.0', 2000, 1), ('bitlish', 'Bitlish', 'https://bitlish.com', 'https://bitlish.com/api', FALSE, '1.0.0', 2000, 1), ('bitmarket', 'BitMarket', 'https://www.bitmarket.pl', 'https://www.bitmarket.net/docs.php?file=api_public.html', FALSE, NULL, 2000, 1), ('bitmex', 'BitMEX', 'https://www.bitmex.com', 'https://www.bitmex.com/app/apiOverview', TRUE, '1.0.0', 2000, 1), ('bitsane', 'Bitsane', 'https://bitsane.com', 'https://bitsane.com/info-api', FALSE, NULL, 2000, 1), ('bitso', 'Bitso', 'https://bitso.com', 'https://bitso.com/api_info', FALSE, '3.0.0', 2000, 1), ('bitstamp', 'Bitstamp', 'https://www.bitstamp.net', 'https://www.bitstamp.net/api', FALSE, '2.0.0', 2000, 1), ('bitstamp1', 'Bitstamp v1', 'https://www.bitstamp.net', 'https://www.bitstamp.net/api', FALSE, '1.0.0', 2000, 1), ('bittrex', 'Bittrex', 'https://bittrex.com', 'https://bittrex.com/Home/Api', FALSE, '1.1.0', 2000, 1), ('bitz', 'Bit-Z', 'https://www.bit-z.com', 'https://www.bit-z.com/api.html', FALSE, '1.0.0', 2000, 1), ('bl3p', 'BL3P', 'https://bl3p.eu', 'https://github.com/BitonicNL/bl3p-api/tree/master/docs', FALSE, '1.0.0', 2000, 1), ('bleutrade', 'Bleutrade', 'https://bleutrade.com', 'https://bleutrade.com/help/API', FALSE, '2.0.0', 2000, 1), ('braziliex', 'Braziliex', 'https://braziliex.com', 'https://braziliex.com/exchange/api.php', FALSE, NULL, 2000, 1), ('btcalpha', 'BTC-Alpha', 'https://btc-alpha.com', 'https://btc-alpha.github.io/api-docs/', FALSE, '1.0.0', 2000, 1), ('btcbox', 'BtcBox', 'https://www.btcbox.co.jp', 'https://www.btcbox.co.jp/help/asm', FALSE, '1.0.0', 2000, 1), ('btcchina', 'BTCChina', 'https://www.btcchina.com', 'https://www.btcchina.com/apidocs', FALSE, '1.0.0', 2000, 1), ('btcexchange', 'BTCExchange', 'https://www.btcexchange.ph', 'https://github.com/BTCTrader/broker-api-docs', FALSE, NULL, 2000, 1), ('btcmarkets', 'BTC Markets', 'https://btcmarkets.net', 'https://github.com/BTCMarkets/API', FALSE, NULL, 2000, 1), ('btctradeim', 'BtcTrade.im', 'https://www.btctrade.im', 'https://www.btctrade.im/help.api.html', FALSE, NULL, 2000, 1), ('btctradeua', 'BTC Trade UA', 'https://btc-trade.com.ua', 'https://docs.google.com/document/d/1ocYA0yMy_RXd561sfG3qEPZ80kyll36HUxvCRe5GbhE/edit', FALSE, NULL, 2000, 1), ('btcturk', 'BTCTurk', 'https://www.btcturk.com', 'https://github.com/BTCTrader/broker-api-docs', FALSE, NULL, 2000, 1), ('btcx', 'BTCX', 'https://btc-x.is', 'https://btc-x.is/custom/api-document.html', FALSE, '1.0.0', 2000, 1), ('bxinth', 'BX.in.th', 'https://bx.in.th', 'https://bx.in.th/info/api', FALSE, NULL, 2000, 1), ('ccex', 'C-CEX', 'https://c-cex.com', 'https://c-cex.com/?id=api', FALSE, NULL, 2000, 1), ('cex', 'CEX.IO', 'https://cex.io', 'https://cex.io/cex-api', FALSE, NULL, 2000, 1), ('chbtc', 'CHBTC', 'https://trade.chbtc.com', 'https://www.chbtc.com/i/developer', FALSE, '1.0.0', 2000, 1), ('chilebit', 'ChileBit', 'https://chilebit.net', 'https://blinktrade.com/docs', FALSE, '1.0.0', 2000, 1), ('cobinhood', 'COBINHOOD', 'https://cobinhood.com', 'https://cobinhood.github.io/api-public', FALSE, NULL, 2000, 1), ('coinbase', 'coinbase', 'https://www.coinbase.com', 'https://developers.coinbase.com/api/v2', TRUE, '2.0.0', 2000, 1), ('coinbasepro', 'Coinbase Pro', 'https://pro.coinbase.com', 'https://docs.gdax.com', FALSE, NULL, 2000, 1), ('coincheck', 'coincheck', 'https://coincheck.com', 'https://coincheck.com/documents/exchange/api', FALSE, NULL, 2000, 1), ('coinegg', 'CoinEgg', 'https://www.coinegg.com', 'https://www.coinegg.com/explain.api.html', FALSE, NULL, 2000, 1), ('coinex', 'CoinEx', 'https://www.coinex.com', 'https://github.com/coinexcom/coinex_exchange_api/wiki', FALSE, '1.0.0', 2000, 1), ('coinexchange', 'CoinExchange', 'https://www.coinexchange.io', 'https://coinexchangeio.github.io/slate/', FALSE, NULL, 2000, 1), ('coinfalcon', 'CoinFalcon', 'https://coinfalcon.com', 'https://docs.coinfalcon.com', FALSE, NULL, 2000, 1), ('coinfloor', 'coinfloor', 'https://www.coinfloor.co.uk', 'https://github.com/coinfloor/api', FALSE, NULL, 2000, 1), ('coingi', 'Coingi', 'https://coingi.com', 'http://docs.coingi.apiary.io/', FALSE, NULL, 2000, 1), ('coinmarketcap', 'CoinMarketCap', 'https://coinmarketcap.com', 'https://coinmarketcap.com/api', FALSE, '1.0.0', 2000, 1), ('coinmate', 'CoinMate', 'https://coinmate.io', 'http://docs.coinmate.apiary.io', FALSE, NULL, 2000, 1), ('coinnest', 'coinnest', 'https://www.coinnest.co.kr', 'https://www.coinnest.co.kr/doc/intro.html', FALSE, NULL, 2000, 1), ('coinone', 'CoinOne', 'https://coinone.co.kr', 'https://doc.coinone.co.kr', FALSE, '2.0.0', 2000, 1), ('coinsecure', 'Coinsecure', 'https://coinsecure.in', 'https://api.coinsecure.in', FALSE, '1.0.0', 2000, 1), ('coinspot', 'CoinSpot', 'https://www.coinspot.com.au', 'https://www.coinspot.com.au/api', FALSE, NULL, 2000, 1), ('cointiger', 'CoinTiger', 'https://www.cointiger.pro', 'https://github.com/cointiger/api-docs-en/wiki', FALSE, '1.0.0', 2000, 1), ('coolcoin', 'CoolCoin', 'https://www.coolcoin.com', 'https://www.coolcoin.com/help.api.html', FALSE, NULL, 2000, 1), ('crypton', 'Crypton', 'https://cryptonbtc.com', 'https://cryptonbtc.docs.apiary.io/', FALSE, '1.0.0', 2000, 1), ('cryptopia', 'Cryptopia', 'https://www.cryptopia.co.nz', 'https://www.cryptopia.co.nz/Forum/Category/45', FALSE, NULL, 2000, 1), ('deribit', 'Deribit', 'https://www.deribit.com', 'https://www.deribit.com/pages/docs/api', FALSE, '1.0.0', 2000, 1), ('dsx', 'DSX', 'https://dsx.uk', 'https://api.dsx.uk', FALSE, '3.0.0', 2000, 1), ('ethfinex', 'Ethfinex', 'https://www.ethfinex.com', 'https://bitfinex.readme.io/v1/docs', FALSE, '1.0.0', 2000, 1), ('exmo', 'EXMO', 'https://exmo.me', 'https://exmo.me/en/api_doc', FALSE, '1.0.0', 2000, 1), ('exx', 'EXX', 'https://www.exx.com', 'https://www.exx.com/help/restApi', FALSE, NULL, 2000, 1), ('fcoin', 'FCoin', 'https://www.fcoin.com', 'https://developer.fcoin.com', FALSE, '2.0.0', 2000, 1), ('flowbtc', 'flowBTC', 'https://trader.flowbtc.com', 'https://www.flowbtc.com.br/api.html', FALSE, '1.0.0', 2000, 1), ('foxbit', 'FoxBit', 'https://foxbit.exchange', 'https://blinktrade.com/docs', FALSE, '1.0.0', 2000, 1), ('fybse', 'FYB-SE', 'https://www.fybse.se', 'http://docs.fyb.apiary.io', FALSE, NULL, 2000, 1), ('fybsg', 'FYB-SG', 'https://www.fybsg.com', 'http://docs.fyb.apiary.io', FALSE, NULL, 2000, 1), ('gatecoin', 'Gatecoin', 'https://gatecoin.com', 'https://gatecoin.com/api', FALSE, NULL, 2000, 1), ('gateio', 'Gate.io', 'https://gate.io', 'https://gate.io/api2', FALSE, '2.0.0', 2000, 1), ('gdax', 'GDAX', 'https://www.gdax.com', 'https://docs.gdax.com', FALSE, NULL, 2000, 1), ('gemini', 'Gemini', 'https://gemini.com', 'https://docs.gemini.com/rest-api', FALSE, '1.0.0', 2000, 1), ('getbtc', 'GetBTC', 'https://getbtc.org', 'https://getbtc.org/api-docs.php', FALSE, NULL, 2000, 1), ('hadax', 'HADAX', 'https://www.huobi.br.com/en-us', 'https://github.com/huobiapi/API_Docs/wiki', FALSE, '1.0.0', 2000, 1), ('hitbtc', 'HitBTC', 'https://hitbtc.com', 'https://github.com/hitbtc-com/hitbtc-api/blob/master/APIv1.md', FALSE, '1.0.0', 2000, 1), ('hitbtc2', 'HitBTC v2', 'https://hitbtc.com', 'https://api.hitbtc.com', FALSE, '2.0.0', 2000, 1), ('huobi', 'Huobi', 'https://www.huobi.com', 'https://github.com/huobiapi/API_Docs_en/wiki', FALSE, '3.0.0', 2000, 1), ('huobicny', 'Huobi CNY', 'https://www.huobi.br.com/en-us', 'https://github.com/huobiapi/API_Docs/wiki/REST_api_reference', FALSE, '1.0.0', 2000, 1), ('huobipro', 'Huobi Pro', 'https://www.huobi.br.com/en-us', 'https://github.com/huobiapi/API_Docs/wiki/REST_api_reference', FALSE, '1.0.0', 2000, 1), ('ice3x', 'ICE3X', 'https://ice3x.com', 'https://ice3x.co.za/ice-cubed-bitcoin-exchange-api-documentation-1-june-2017', FALSE, NULL, 2000, 1), ('independentreserve', 'Independent Reserve', 'https://www.independentreserve.com', 'https://www.independentreserve.com/API', FALSE, NULL, 2000, 1), ('indodax', 'INDODAX', 'https://www.indodax.com', 'https://indodax.com/downloads/BITCOINCOID-API-DOCUMENTATION.pdf', FALSE, '1.8.0', 2000, 1), ('itbit', 'itBit', 'https://www.itbit.com', 'https://api.itbit.com/docs', FALSE, '1.0.0', 2000, 1), ('jubi', 'jubi.com', 'https://www.jubi.com', 'https://www.jubi.com/help/api.html', FALSE, '1.0.0', 2000, 1), ('kraken', 'Kraken', 'https://www.kraken.com', 'https://www.kraken.com/en-us/help/api', FALSE, '0.0.0', 2000, 1), ('kucoin', 'Kucoin', 'https://www.kucoin.com', 'https://kucoinapidocs.docs.apiary.io', FALSE, '1.0.0', 2000, 1), ('kuna', 'Kuna', 'https://kuna.io', 'https://kuna.io/documents/api', FALSE, '2.0.0', 2000, 1), ('lakebtc', 'LakeBTC', 'https://www.lakebtc.com', 'https://www.lakebtc.com/s/api_v2', FALSE, '2.0.0', 2000, 1), ('lbank', 'LBank', 'https://www.lbank.info', 'https://github.com/LBank-exchange/lbank-official-api-docs', FALSE, '1.0.0', 2000, 1), ('liqui', 'Liqui', 'https://liqui.io', 'https://liqui.io/api', FALSE, '3.0.0', 2000, 1), ('liquid', 'Liquid', 'https://www.liquid.com', 'https://developers.quoine.com/', FALSE, '2.0.0', 2000, 1), ('livecoin', 'LiveCoin', 'https://www.livecoin.net', 'https://www.livecoin.net/api?lang=en', FALSE, NULL, 2000, 1), ('luno', 'luno', 'https://www.luno.com', 'https://www.luno.com/en/api', FALSE, '1.0.0', 2000, 1), ('lykke', 'Lykke', 'https://www.lykke.com', 'https://hft-api.lykke.com/swagger/ui/', FALSE, '1.0.0', 2000, 1), ('mercado', 'Mercado Bitcoin', 'https://www.mercadobitcoin.com.br', 'https://www.mercadobitcoin.com.br/api-doc', FALSE, '3.0.0', 2000, 1), ('mixcoins', 'MixCoins', 'https://mixcoins.com', 'https://mixcoins.com/help/api/', FALSE, '1.0.0', 2000, 1), ('negociecoins', 'NegocieCoins', 'https://www.negociecoins.com.br', 'https://www.negociecoins.com.br/documentacao-tradeapi', FALSE, '3.0.0', 2000, 1), ('nova', 'Novaexchange', 'https://novaexchange.com', 'https://novaexchange.com/remote/faq', FALSE, '2.0.0', 2000, 1), ('okcoincny', 'OKCoin CNY', 'https://www.okcoin.cn', 'https://www.okcoin.cn/rest_getStarted.html', FALSE, '1.0.0', 2000, 1), ('okcoinusd', 'OKCoin USD', 'https://www.okcoin.com', 'https://www.okcoin.com/rest_getStarted.html', FALSE, '1.0.0', 2000, 1), ('okex', 'OKEX', 'https://www.okex.com', 'https://github.com/okcoin-okex/API-docs-OKEx.com', FALSE, '1.0.0', 2000, 1), ('paymium', 'Paymium', 'https://www.paymium.com', 'https://github.com/Paymium/api-documentation', FALSE, '1.0.0', 2000, 1), ('poloniex', 'Poloniex', 'https://poloniex.com', 'https://poloniex.com/support/api/', FALSE, NULL, 2000, 1), ('qryptos', 'QRYPTOS', 'https://www.qryptos.com', 'https://developers.quoine.com', FALSE, '2.0.0', 2000, 1), ('quadrigacx', 'QuadrigaCX', 'https://www.quadrigacx.com', 'https://www.quadrigacx.com/api_info', FALSE, '2.0.0', 2000, 1), ('quoinex', 'QUOINEX', 'https://quoinex.com', 'https://developers.quoine.com', FALSE, '2.0.0', 2000, 1), ('rightbtc', 'RightBTC', 'https://www.rightbtc.com', 'https://www.rightbtc.com/ApiWeb/Public-API', FALSE, '2.1.0', 2000, 1), ('southxchange', 'SouthXchange', 'https://www.southxchange.com', 'https://www.southxchange.com/Home/Api', FALSE, NULL, 2000, 1), ('surbitcoin', 'SurBitcoin', 'https://surbitcoin.com', 'https://blinktrade.com/docs', FALSE, NULL, 2000, 1), ('theocean', 'The Ocean', 'https://theocean.trade', 'https://docs.theocean.trade/', FALSE, '0.0.0', 2000, 1), ('therock', 'TheRockTrading', 'https://therocktrading.com', 'https://api.therocktrading.com/doc/v1/index.html', FALSE, '1.0.0', 2000, 1), ('tidebit', 'TideBit', 'https://www.tidebit.com', 'https://www.tidebit.com/documents/api_v2', FALSE, '2.0.0', 2000, 1), ('tidex', 'Tidex', 'https://tidex.com', 'https://tidex.com/exchange/public-api', FALSE, '3.0.0', 2000, 1), ('uex', 'UEX', 'https://www.uex.com', 'https://download.uex.com/doc/UEX-API-English-1.0.3.pdf', FALSE, '1.0.3', 2000, 1), ('urdubit', 'UrduBit', 'https://urdubit.com', 'https://blinktrade.com/docs', FALSE, '1.0.0', 2000, 1), ('vaultoro', 'Vaultoro', 'https://www.vaultoro.com', 'https://api.vaultoro.com', FALSE, '1.0.0', 2000, 1), ('vbtc', 'VBTC', 'https://vbtc.exchange', 'https://blinktrade.com/docs', FALSE, '1.0.0', 2000, 1), ('virwox', 'VirWoX', 'https://www.virwox.com', 'https://www.virwox.com/developers.php', FALSE, NULL, 2000, 1), ('wex', 'WEX', 'https://wex.nz', 'https://wex.nz/api/3/docs', FALSE, '3.0.0', 2000, 1), ('xbtce', 'xBTCe', 'https://www.xbtce.com', 'https://www.xbtce.com/tradeapi', FALSE, '1.0.0', 2000, 1), ('yobit', 'YoBit', 'https://www.yobit.net', 'https://www.yobit.net/en/api/', TRUE, '3.0.0', 2000, 1), ('yunbi', 'YUNBI', 'https://yunbi.com', 'https://yunbi.com/documents/api/guide', FALSE, '2.0.0', 2000, 1), ('zaif', 'Zaif', 'https://zaif.jp', 'http://techbureau-api-document.readthedocs.io/ja/latest/index.html', FALSE, '1.0.0', 2000, 1), ('zb', 'ZB', 'https://www.zb.com', 'https://www.zb.com/i/developer', FALSE, '1.0.0', 2000, 1); -- [ STOCKS ] INSERT INTO exchanges (slug, name, url_www, url_api, is_active, version, timeout, rate_limit) VALUES ('amex', 'AMEX', 'https://www.amex.com/', 'https://www.nasdaq.com/solutions/nasdaq-contributor-api', FALSE, NULL, 2000, 1), ('nasdaq', 'NASDAQ', 'https://www.nasdaq.com/', 'https://www.nasdaq.com/solutions/nasdaq-contributor-api', FALSE, NULL, 2000, 1), ('nyse', 'NYSE', 'https://www.nyse.com/', 'https://www.nyse.com/publicdocs/nyse/markets/nyse/NYSEUTPDirect_Specification.pdf', FALSE, NULL, 2000, 1); DROP TABLE IF EXISTS exchange_types; CREATE TABLE exchange_types ( slug VARCHAR(25) NOT NULL, type_id SMALLINT DEFAULT NULL ); -- [ CRYPTOCURRENCIES ] INSERT INTO exchange_types (slug, type_id) VALUES ('_1broker', 2), ('_1btcxe', 2), ('acx', 2), ('allcoin', 2), ('anxpro', 2), ('anxpro', 2), ('anxpro', 2), ('anxpro', 2), ('anybits', 2), ('bcex', 2), ('bcex', 2), ('bibox', 2), ('bibox', 2), ('bibox', 2), ('binance', 2), ('bit2c', 2), ('bitbank', 2), ('bitbay', 2), ('bitfinex', 2), ('bitfinex2', 2), ('bitflyer', 2), ('bitforex', 2), ('bithumb', 2), ('bitkk', 2), ('bitlish', 2), ('bitlish', 2), ('bitmarket', 2), ('bitmex', 2), ('bitsane', 2), ('bitso', 2), ('bitstamp', 2), ('bitstamp1', 2), ('bittrex', 2), ('bitz', 2), ('bl3p', 2), ('bleutrade', 2), ('braziliex', 2), ('btcalpha', 2), ('btcbox', 2), ('btcchina', 2), ('btcexchange', 2), ('btcmarkets', 2), ('btctradeim', 2), ('btctradeua', 2), ('btcturk', 2), ('btcx', 2), ('btcx', 2), ('bxinth', 2), ('ccex', 2), ('cex', 2), ('cex', 2), ('cex', 2), ('chbtc', 2), ('chilebit', 2), ('cobinhood', 2), ('coinbase', 2), ('coinbasepro', 2), ('coincheck', 2), ('coincheck', 2), ('coinegg', 2), ('coinegg', 2), ('coinex', 2), ('coinexchange', 2), ('coinexchange', 2), ('coinexchange', 2), ('coinexchange', 2), ('coinexchange', 2), ('coinfalcon', 2), ('coinfloor', 2), ('coingi', 2), ('coingi', 2), ('coingi', 2), ('coingi', 2), ('coinmarketcap', 2), ('coinmate', 2), ('coinmate', 2), ('coinnest', 2), ('coinone', 2), ('coinsecure', 2), ('coinspot', 2), ('cointiger', 2), ('coolcoin', 2), ('crypton', 2), ('cryptopia', 2), ('deribit', 2), ('dsx', 2), ('ethfinex', 2), ('exmo', 2), ('exmo', 2), ('exx', 2), ('fcoin', 2), ('flowbtc', 2), ('foxbit', 2), ('fybse', 2), ('fybsg', 2), ('gatecoin', 2), ('gateio', 2), ('gdax', 2), ('gemini', 2), ('getbtc', 2), ('getbtc', 2), ('hadax', 2), ('hitbtc', 2), ('hitbtc2', 2), ('huobi', 2), ('huobicny', 2), ('huobipro', 2), ('ice3x', 2), ('independentreserve', 2), ('independentreserve', 2), ('indodax', 2), ('itbit', 2), ('jubi', 2), ('kraken', 2), ('kucoin', 2), ('kuna', 2), ('lakebtc', 2), ('lbank', 2), ('liqui', 2), ('liquid', 2), ('liquid', 2), ('liquid', 2), ('livecoin', 2), ('livecoin', 2), ('livecoin', 2), ('luno', 2), ('luno', 2), ('luno', 2), ('lykke', 2), ('mercado', 2), ('mixcoins', 2), ('mixcoins', 2), ('negociecoins', 2), ('nova', 2), ('okcoincny', 2), ('okcoinusd', 2), ('okcoinusd', 2), ('okex', 2), ('okex', 2), ('paymium', 2), ('poloniex', 2), ('qryptos', 2), ('qryptos', 2), ('quadrigacx', 2), ('quoinex', 2), ('quoinex', 2), ('quoinex', 2), ('rightbtc', 2), ('southxchange', 2), ('surbitcoin', 2), ('theocean', 2), ('therock', 2), ('tidebit', 2), ('tidex', 2), ('uex', 2), ('uex', 2), ('urdubit', 2), ('vaultoro', 2), ('vbtc', 2), ('virwox', 2), ('wex', 2), ('xbtce', 2), ('yobit', 2), ('yunbi', 2), ('zaif', 2), ('zb', 2); -- [ STOCKS ] INSERT INTO exchange_types (slug, type_id) VALUES ('forex', 1), ('amex', 3), ('amex', 4), ('amex', 5), ('nasdaq', 3), ('nasdaq', 4), ('nasdaq', 5), ('nyse', 3), ('nyse', 4), ('nyse', 5); DROP TABLE IF EXISTS exchange_countries; CREATE TABLE exchange_countries ( slug VARCHAR(25) NOT NULL, country_iso VARCHAR(155) DEFAULT NULL ); -- [ STOCKS ] INSERT INTO exchange_countries (slug, country_iso) VALUES ('_1broker', 'us'), ('_1btcxe', 'pa'), ('acx', 'au'), ('allcoin', 'ca'), ('anxpro', 'jp'), ('anxpro', 'sg'), ('anxpro', 'hk'), ('anxpro', 'nz'), ('anybits', 'ir'), ('bcex', 'cn'), ('bcex', 'ca'), ('bibox', 'cn'), ('bibox', 'us'), ('bibox', 'kr'), ('binance', 'jp'), ('bit2c', 'il'), ('bitbank', 'jp'), ('bitbay', 'mt'), ('bitfinex', 'vg'), ('bitfinex2', 'vg'), ('bitflyer', 'jp'), ('bitforex', 'cn'), ('bithumb', 'kr'), ('bitkk', 'cn'), ('bitlish', 'uk'), ('bitlish', 'ru'), ('bitmarket', 'pl'), ('bitmex', 'sc'), ('bitsane', 'ir'), ('bitso', 'mx'), ('bitstamp', 'uk'), ('bitstamp1', 'uk'), ('bittrex', 'us'), ('bitz', 'hk'), ('bl3p', 'nl'), ('bleutrade', 'br'), ('braziliex', 'br'), ('btcalpha', 'us'), ('btcbox', 'jp'), ('btcchina', 'cn'), ('btcexchange', 'ph'), ('btcmarkets', 'au'), ('btctradeim', 'hk'), ('btctradeua', 'ua'), ('btcturk', 'tr'), ('btcx', 'is'), ('btcx', 'us'), ('bxinth', 'th'), ('ccex', 'de'), ('cex', 'uk'), ('cex', 'cy'), ('cex', 'ru'), ('chbtc', 'cn'), ('chilebit', 'cl'), ('cobinhood', 'tw'), ('coinbase', 'us'), ('coinbasepro', 'us'), ('coincheck', 'jp'), ('coincheck', 'id'), ('coinegg', 'cn'), ('coinegg', 'uk'), ('coinex', 'cn'), ('coinexchange', 'in'), ('coinexchange', 'jp'), ('coinexchange', 'kr'), ('coinexchange', 'vn'), ('coinexchange', 'us'), ('coinfalcon', 'uk'), ('coinfloor', 'uk'), ('coingi', 'pa'), ('coingi', 'bg'), ('coingi', 'cn'), ('coingi', 'us'), ('coinmarketcap', 'us'), ('coinmate', 'uk'), ('coinmate', 'cz'), ('coinnest', 'kr'), ('coinone', 'kr'), ('coinsecure', 'in'), ('coinspot', 'au'), ('cointiger', 'cn'), ('coolcoin', 'hk'), ('crypton', null), ('cryptopia', 'nz'), ('deribit', 'nl'), ('dsx', 'uk'), ('ethfinex', 'vg'), ('exmo', 'es'), ('exmo', 'ru'), ('exx', 'cn'), ('fcoin', 'cn'), ('flowbtc', 'br'), ('foxbit', 'br'), ('fybse', 'se'), ('fybsg', 'sg'), ('gatecoin', 'hk'), ('gateio', 'cn'), ('gdax', 'us'), ('gemini', 'us'), ('getbtc', 'vc'), ('getbtc', 'ru'), ('hadax', 'cn'), ('hitbtc', 'hk'), ('hitbtc2', 'hk'), ('huobi', 'cn'), ('huobicny', 'cn'), ('huobipro', 'cn'), ('ice3x', 'za'), ('independentreserve', 'au'), ('independentreserve', 'nz'), ('indodax', 'id'), ('itbit', 'us'), ('jubi', 'cn'), ('kraken', 'us'), ('kucoin', 'hk'), ('kuna', 'ua'), ('lakebtc', 'us'), ('lbank', 'cn'), ('liqui', 'ua'), ('liquid', 'jp'), ('liquid', 'cn'), ('liquid', 'tw'), ('livecoin', 'us'), ('livecoin', 'uk'), ('livecoin', 'ru'), ('luno', 'uk'), ('luno', 'sg'), ('luno', 'za'), ('lykke', 'ch'), ('mercado', 'br'), ('mixcoins', 'uk'), ('mixcoins', 'hk'), ('negociecoins', 'br'), ('nova', 'tz'), ('okcoincny', 'cn'), ('okcoinusd', 'cn'), ('okcoinusd', 'us'), ('okex', 'cn'), ('okex', 'us'), ('paymium', 'fr'), ('poloniex', 'us'), ('qryptos', 'cn'), ('qryptos', 'tw'), ('quadrigacx', 'ca'), ('quoinex', 'jp'), ('quoinex', 'sg'), ('quoinex', 'vn'), ('rightbtc', 'ae'), ('southxchange', 'ar'), ('surbitcoin', 'us'), ('theocean', 'us'), ('therock', 'mt'), ('tidebit', 'hk'), ('tidex', 'uk'), ('uex', 'sg'), ('uex', 'us'), ('urdubit', 'pk'), ('vaultoro', 'ch'), ('vbtc', 'vn'), ('virwox', 'au'), ('wex', 'nz'), ('xbtce', 'ru'), ('yobit', 'ru'), ('yunbi', 'cn'), ('zaif', 'jp'), ('zb', 'cn'); -- [ STOCKS ] INSERT INTO exchange_countries (slug, country_iso) VALUES ('amex', 'us'), ('nasdaq', 'us'), ('nyse', 'us'); DROP TABLE IF EXISTS exchange_markets; CREATE TABLE exchange_markets ( exchange_slug VARCHAR(25) NOT NULL, exchange_market_id VARCHAR(30) NOT NULL, ticker_slug VARCHAR(55) DEFAULT NULL, base_id VARCHAR(55) DEFAULT NULL, quote_id VARCHAR(55) DEFAULT NULL, is_spot BOOLEAN NOT NULL DEFAULT FALSE, is_margin BOOLEAN NOT NULL DEFAULT FALSE, is_future BOOLEAN NOT NULL DEFAULT FALSE, is_active BOOLEAN NOT NULL DEFAULT FALSE, is_enable BOOLEAN NOT NULL DEFAULT FALSE ); DROP TABLE IF EXISTS markets; CREATE TABLE markets ( ticker_slug VARCHAR(55) DEFAULT NULL, base_id VARCHAR(55) DEFAULT NULL, quote_id VARCHAR(55) DEFAULT NULL, is_active BOOLEAN NOT NULL DEFAULT FALSE, exchanges_slug VARCHAR ARRAY NOT NULL, ids_slug VARCHAR ARRAY NOT NULL ); DROP TABLE IF EXISTS market_fees; CREATE TABLE market_fees ( exchange_slug VARCHAR(25) NOT NULL, base_id VARCHAR(55) DEFAULT NULL, quote_id VARCHAR(55) DEFAULT NULL, tacker INTEGER DEFAULT NULL, maker INTEGER DEFAULT NULL, is_percent BOOLEAN NOT NULL DEFAULT FALSE ); DROP TABLE IF EXISTS market_precision; CREATE TABLE market_precision ( exchange_slug VARCHAR(25) NOT NULL, base_id VARCHAR(55) DEFAULT NULL, quote_id VARCHAR(55) DEFAULT NULL, base_precision INTEGER DEFAULT NULL, quote_precision INTEGER DEFAULT NULL, amount SMALLINT NOT NULL DEFAULT 8, price SMALLINT NOT NULL DEFAULT 8 ); DROP TABLE IF EXISTS market_limits; CREATE TABLE market_limits ( exchange_slug VARCHAR(25) NOT NULL, base_id VARCHAR(55) NOT NULL, quote_id VARCHAR(55) NOT NULL, min_amount BIGINT DEFAULT NULL, max_amount BIGINT DEFAULT NULL, min_price BIGINT DEFAULT NULL, max_price BIGINT DEFAULT NULL, min_cost BIGINT DEFAULT NULL, max_cost BIGINT DEFAULT NULL, min_market BIGINT DEFAULT NULL, max_market BIGINT DEFAULT NULL ); DROP TABLE IF EXISTS market_tickers; CREATE TABLE market_tickers ( exchange_market_slug VARCHAR(25) NOT NULL, exchange_slug VARCHAR(25) NOT NULL, base_id VARCHAR(55) NOT NULL, quote_id VARCHAR(55) NOT NULL, open BIGINT NOT NULL, high BIGINT NOT NULL, low BIGINT NOT NULL, close BIGINT NOT NULL, volume BIGINT NOT NULL, last_update BIGINT NOT NULL ); DROP TABLE IF EXISTS trade_types; CREATE TABLE trade_types ( id SMALLINT NOT NULL, name VARCHAR(30) NOT NULL, slug VARCHAR(30) NOT NULL, PRIMARY KEY ("id") ); INSERT INTO trade_types (id, name, slug) VALUES (1, 'Bid', 'bid'), (2, 'Ask', 'ask'), (3, 'Buy', 'buy'), (4, 'Sell', 'sell'); DROP TABLE IF EXISTS market_trades; CREATE TABLE market_trades ( exchange_market_slug VARCHAR(25) NOT NULL, exchange_slug VARCHAR(25) NOT NULL, base_id VARCHAR(55) NOT NULL, quote_id VARCHAR(55) NOT NULL, trade_type_id SMALLINT NOT NULL, tx_id VARCHAR(55) DEFAULT NULL, price BIGINT DEFAULT NULL, amount BIGINT DEFAULT NULL, last_update BIGINT NOT NULL ); DROP TABLE IF EXISTS market_orderbooks; CREATE TABLE market_orderbooks ( exchange_market_slug VARCHAR(25) NOT NULL, exchange_slug VARCHAR(25) NOT NULL, base_id VARCHAR(55) NOT NULL, quote_id VARCHAR(55) NOT NULL, trade_type_id SMALLINT NOT NULL, price BIGINT DEFAULT NULL, amount BIGINT DEFAULT NULL, last_update BIGINT NOT NULL );
<reponame>trigyn-products/jquiver<gh_stars>0 DROP TABLE IF EXISTS `jq_master_module_role_association`; DROP TABLE IF EXISTS `jq_master_module`; CREATE TABLE `jq_master_module` ( `master_module_id` varchar(50) NOT NULL, `master_module_name` varchar(100) NOT NULL, `grid_details_id` varchar(50) NOT NULL, `module_type` varchar(50) NOT NULL, PRIMARY KEY (`master_module_id`), UNIQUE KEY `master_module_name` (`master_module_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
drop table if exists demo.org_user cascade;
CREATE TABLE [nomenclature].[ActionType] ( [ActionTypeId] INT NOT NULL, [Name] VARCHAR (100) NULL, CONSTRAINT [ActionTypeId_pk] PRIMARY KEY CLUSTERED ([ActionTypeId] ASC) );
create table temperature.temperature ( ID int auto_increment primary key, Temp float null, Time timestamp null, Location char(255) null );
<gh_stars>1-10 select distinct ClientVersion, count(*) as Installs from v_CombinedDeviceResources group by ClientVersion order by ClientVersion
CREATE INDEX IF NOT EXISTS index_eg_pt_billingslab_v2_tenantid ON eg_pt_billingslab_v2 (tenantid); CREATE INDEX IF NOT EXISTS index_eg_pt_billingslab_v2_propertytype ON eg_pt_billingslab_v2 (propertytype); CREATE INDEX IF NOT EXISTS index_eg_pt_billingslab_v2_propertysubtype ON eg_pt_billingslab_v2 (propertysubtype); CREATE INDEX IF NOT EXISTS index_eg_pt_billingslab_v2_usagecategorymajor ON eg_pt_billingslab_v2 (usagecategorymajor); CREATE INDEX IF NOT EXISTS index_eg_pt_billingslab_v2_usagecategoryminor ON eg_pt_billingslab_v2 (usagecategoryminor); ALTER TABLE eg_pt_mutation_billingslab ADD PRIMARY KEY (id, tenantid); CREATE INDEX IF NOT EXISTS index_eg_pt_mutation_billingslab_usagecategoryminor ON eg_pt_mutation_billingslab (usagecategoryminor); CREATE INDEX IF NOT EXISTS index_eg_pt_mutation_billingslab_usagecategorymajor ON eg_pt_mutation_billingslab (usagecategorymajor); CREATE INDEX IF NOT EXISTS index_eg_pt_mutation_billingslab_tenantid ON eg_pt_mutation_billingslab (tenantid); CREATE INDEX IF NOT EXISTS index_eg_pt_mutation_billingslab_propertytype ON eg_pt_mutation_billingslab (propertytype); CREATE INDEX IF NOT EXISTS index_eg_pt_mutation_billingslab_propertysubtype ON eg_pt_mutation_billingslab (propertysubtype); CREATE INDEX IF NOT EXISTS index_eg_pt_mutation_billingslab_ownershipcategory ON eg_pt_mutation_billingslab (ownershipcategory); CREATE INDEX IF NOT EXISTS index_eg_pt_mutation_billingslab_subownershipcategory ON eg_pt_mutation_billingslab (subownershipcategory);
<filename>src/test/resources/tclsqlite.test_65.sql -- tclsqlite.test -- -- db eval {INSERT INTO t5 VALUES(x)} INSERT INTO t5 VALUES(x)
<reponame>heryvandoro/ehunter-backend<gh_stars>1-10 -- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2 -- http://www.phpmyadmin.net -- -- Host: localhost:3306 -- Generation Time: May 15, 2018 at 01:55 PM -- Server version: 5.7.22-0ubuntu0.16.04.1 -- PHP Version: 7.0.30-0ubuntu0.16.04.1 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 utf8mb4 */; -- -- Database: `ehunter` -- -- -------------------------------------------------------- -- -- Table structure for table `companies` -- CREATE TABLE `companies` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `logo` varchar(255) NOT NULL DEFAULT 'company_logo.png', `description` text ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `companies` -- INSERT INTO `companies` (`id`, `name`, `email`, `password`, `logo`, `description`) VALUES (1, 'PT Toyota', '<EMAIL>', 'testing', 'company_logo.png', 'test'), (2, 'BNCC', '<EMAIL>', '<PASSWORD>', 'BNCC_T.png', NULL), (3, 'PT Bina Nusa Kembangan', 'test@a', '$2b$10$sHR8UevNVZKO9ubSLdySQeD38Pk2eW3EDVNO0bjwBJp3rqC0O21Xy', 'NusaKembangan.png', NULL), (4, 'Bukalapak', '<EMAIL>', <PASSWORD>', 'bukalapak.png', NULL), (5, 'Tokopedia', '<EMAIL>', <PASSWORD>', 'tokopedia.png', 'test 2 34'), (6, '<NAME>', '<EMAIL>', 'example', 'binus.png', 'Ini Kumpeni Binus'), (7, 'Kudos', '<EMAIL>', 'example', 'kudo.png', 'ini kumpeni kudos'), (8, 'Grab', '<EMAIL>', 'example', 'grab.png', 'ini kumpeni Grab'), (9, 'Alibaba', '<EMAIL>', 'example', 'alibaba.png', 'Ini Perusahaan Alibaba'), (10, 'Rakuten JP', '<EMAIL>', 'example', 'rakuten.png', NULL); -- -------------------------------------------------------- -- -- Table structure for table `hunters` -- CREATE TABLE `hunters` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `bio` varchar(255) DEFAULT NULL, `cv` varchar(255) DEFAULT NULL, `ktp` varchar(255) DEFAULT NULL, `cv_raw` text, `ktp_raw` text ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `hunters` -- INSERT INTO `hunters` (`id`, `name`, `email`, `password`, `bio`, `cv`, `ktp`, `cv_raw`, `ktp_raw`) VALUES (1, '<NAME>', 'test', 'test', '', '1526066751627.doc', NULL, 'A British Curriculum Vitae CURRICULUM VITAE Name <NAME>\nAddress Breestraat 21 2311 AB LEIDEN the Netherlands\nTelephone 31 71 5126511\nEmail GOTOBUTTON BM_1_ jannekehotmailcom\nDate of birth 7 March 1988\nNationality Dutch\nSex Female\nMarital status Single EducationQualifications\n20062010 Leiden University MA in English Language and Literature obtained in 2009\n20002006 Stedelijk Lyceum Arnhem Diploma GymnasiumA gives entry to university in the subjects Dutch Latin French German English History Social Studies and Music Employment to DateWork Experience\n2007present Employment Agency Randfiguur Leiden the Netherlands Post Translator\n2006present Freelance translator\n2009 Translation Agency Snoep en Honnepon Amsterdam the Netherlands Post Trainee Other ExperienceActivities\n20062009 Member of the International Students Association AISLE\n2009 Member of the Exchange Committee of AISLE Leiden Post Assessor Activities Responsibilities Liaisoning with European associate clubs organising social events Languages Dutch native speaker English near native speaker French good German fair Italian good passive skills Russian basic Other Skills Computer literate Windows applications Clean Driving Licence Interests Travelling international affairs European history meeting friends Publications\n2008 As Long as he Catches Rats a Life of Deng Xiao Ping in International Student Weekly 22 81423 References Professor <NAME> Professor of Translation Studies Department of English Leiden University LEIDEN\nMs J Tweehuizen Head of the English Section of Translation Agency Snoep en Honnepon AMSTERDAM ', NULL), (2, '<NAME>', 'test', 'test', '', '1526028079808.pdf', NULL, '<NAME> Teaching Assistant Software Engineer Contact 87 88 516 7008 P ribadiridwan1 stgmailcom Social Media Facebook godfal len Linkedin inpribadi1st Skills PHP Web Service Development Web Client Development Researching new technology Designing Database English German Indonesian Working in Group Profile I am a s oftware engineer with thorough hands n experience in all levels of testing and a teac hing a ssistant with 2 yea r s experiences Seeking a full time position where I can apply my knowledge an d skills for con ti nues imp rovement Experience TEACHING ASSISTANT BINUS UNIVERSITY FEB 2016 FEB 2018 Teaching a programming practicum class Programming case making correcting student case result Teaching new assistant JUNIOR RESEARCHER RESEARCH TECHNOLOGIC AL TRANSFER OF FICE MAR 2017 FEB 2018 Preparing research proposal Collecting model data Analyzing model data Developing research model Education BACHELOR BINUS UNI VERSITY 2014 2018 Current GPA 346 Best RIG research interest group Studied in Artificial Intelligence Major Dewa W eb UI competition Participate Volu nteer Experience or Leadership Volunteer Experience Teaching Kindergarten 2014 Jakarta Marathon 2014 Autism is not a joke Campaign 2015 Volunteer in BIMBEL 2015 Activist in MS Word Com puter Training 2017 Activist in MS Excel computer Training 2017 Entrevolution AIESEC 2016 Seminar or leadership training HTTP Binus Seminar 2014 Me Featuring Social Media with Shopee Talkshow 2015 iDaysGerman Language BinusWorkshop 2015 Campus Life Orientation Binus 2014 Training Assistant Binus 2015 Mentor Comitter 2015 Buddy Coordinator Binus 2015 Open Source Software Development Engineering Seminar 2016 Big Data Seminar Stanford University 2016 Research Workshop with IIAI International Institute of applied informatics japan 2017 AWSOME DAYS WITH AWS EDUCATE AMAZON WEB SERVICE 2017 ', NULL), (3, '<NAME>', 'test', 'test', '', '1525962935837.doc', NULL, 'CURRICULUM VITAE PERSONAL DETAILS Name <NAME> Nationality Greek UK address 209 Queen Alexandra Road Marital Status Married Sunderland SR3 1YF Date of Birth 10041978 GPA Univeristy 300 Telephone 0044 0 7786266730 Age 31 Email EDUCATION AND QUALIFICATIONS UNIVERSITY OF SUNDERLAND\nMA TESOL 2006 BEDE COLLEGE SUNDERLAND NCFE Certificate in Equality and Diversity\nExplore Equality and Diversity Prejudice and Discrimination Peoples Rights and Responsibilities\n2003 BEDE COLLEGE SUNDERLAND NCFE Certificate in Child Psychology Early Experience The Developing Child The Child in Society\nUNIVERSITY OF SUNDERLAND\nBA Hons English Education QTS English Language Literature Linguistics Media Drama\nUNIVERSITY OF SUNDERLAND\nHND Business IT\n19971998 BEDE COLLEGE SUNDERLAND\nA Level English\n1997 ALIARTOS ENGLISH PRIVATE SCHOOL GREECE National Proficiency Certificate in English WORK EXPERIENCE 20082009 English Teacher Castle View School Sunderland\nTeaching English in KS3 and KS4 teaching Literacy as well as teaching guided and group reading as part of the Literacy Strategy in KS3 design implement and assess KS3 Literacy targets devising operational KS34 schemes of work for the English department teaching Greek as an extra curricular activity to pupils and teachers\nClassroom supervision of student teachers and voluntary classroom assistants attending departmental management and school meetings invigilating internal exams marking advising staff on lesson planning Class registration OFSTED February 2009 preparation and observation Oct 20062007 Supply Teacher Castle View School Sunderland\nDuties Teaching English in KS3 and KS4 team teaching Literacy as well as teaching guided and group reading as part of the Literacy Strategy in KS3 design implement and assess KS3 Literacy targets devising operational KS34 schemes of work for the English department teaching Greek as an extra curricula activity to pupils and teachers\nClassroom supervision of student teachers and voluntary classroom assistants attending departmental management and school meetings invigilating internal exams marking advising staff on lesson planning Class registration OFSTED March 2007 Preparation and observation Sept 2005May 2006 English Teacher Kassaris School of English Athens Duties Teaching English in KS3KS5 Personal tutoring of low ability students Liaising with parents report writing invigilation of internal exams designing and implementing schemes of work exam preparation and provision TOEFL MICHIGANLower CAMBRIDGELower MICHIGANProficiency CAMBRIDGEProficiency IELTS Sept 20042006 Assistant Head of the English Department Euromathisi English School Athens\nDuties Teaching of English in Key Stages 35 involved liaising with parents report writing finance management of the English Department dealing with school issues regarding discipline and class management invigilation of internal exams designing and implementing schemes of work exam preparation and provision TOEFL MICHIGANLower CAMBRIDGELower MICHIGANProficiency CAMBRIDGEProficiency IELTS\n Sept 20042005 English Teacher PagoulatouVlachou English School Athens Duties Teaching English to international mature students and professionals I have attended seminars in which I took part as a senior member regarding class management book evaluation exam preparation lesson planning and the production of schemes of work Sept 20042005 EditorProofreader Express Publishing Athens\nDuties Proofreading English teaching materials prior to their publishing Editing and translating governmental texts regarding teaching Producing CDROM teaching materials in English for the puspose of teaching at Key Stage 3 Sept20022004 English and Drama Teacher West Gate Community College Newcastle\nDuties Teaching English at KS3 and KS4\nI held extra curricula activities took part in moderating exams and invigilated internal exams prepared KS3 and KS4 students for their exams and coursework held a key role in students personal and social education attended seminars led the Literacy Strategy targeting year 9 pupils designed and implemented schemes of work attended and held departmental meetings 2001 Trainee English Teacher Thornaby School Stockton\nDuties Teaching English at KS3KS4 This teaching practice enabled me to use a plethora of teaching and learning techniques in order to support the teaching and learning of pupils from the full range of abilities Part of my time I used to enhance my own learning outside the classroom by devising and implementing schemes of work In addition to this I attended departmental and school meetings took part in the moderation of students coursework taught Drama and assisted in students preparation of drama coursework class registration 2001 Trainee English teacher SandhillView School\nDuties Teaching English at KS3KS4 This teaching practice enabled me to utilise differing teaching strategies to support the learning of students from the full range of abilities Part of my time I undertook pastoral and other professional duties In addition to these responsibilities I was able to contribute to extra curricula activities by helping with the school drama group and assisting on drama productions I participated on parents evenings and contributed in report writing attended departmental and school meetings modelled and implemented the Basic Skills unit in KS3 designed and implemented schemes of work prepared KS3 and KS4 classes for their exams taught Gifted and talented classes taught Special Needs classes and kept records of IEPs Summer 1998 Social Activities Organiser Warden St Clares International College Oxford Duties My duties as an SAO involved organising activities for the students trips sports and participating in them As a warden my duties involved taking care of the students under the colleges premises informing and applying the Health and Fire regulations Voluntary Teacher Felstead School Sunderland\nDuties I was assisting pupils with Special Needs to learn English on a voluntary basis Assistant Teacher <NAME> School Thebes Greece\nDuties Teaching and mentoring students with learning difficulties in English INSET 2006 Child Protection Sunderland City Council 20052006 Athens Greece Held seminars in EFL books and their evaluation provision of activities to aid learning 20022004 West Gate Community College Newcastle Literacy Planning and Provision at KS3 KS3 Literacy Training Moderation of Exams Behavioural Management Curriculum Overview Accellerated Learning 2001 St Anthonys Catholic School Sunderland KS23 Transfer Setting TargetsObjectives 2001 University of Sunderland I successfully delivered the National Literacy Framework to a group of trainee teachers at the University of Sunderland SKILLS IT Skills Windows MS Office Access Excel Word Power Point Internet Foreign Languages French Intermediate Spanish Intermediate Greek Proficient Italian Fluent Sporting Interests Outdoor Activities including mountain walking and skiing\nHobbies Reading drawing playing chess swimming REFERENCES 1 <NAME> 2 <NAME>\nHeadteacher Director of MA Studies\nCastle View School University of Sunderland\nCartwright Road School of Education and Lifelong Learning\nHyl<NAME> <NAME> Informatics Centre\nSunderland St Peters Sunderland\nSR5 3DX SR6 0DD Tel 0191 553 5533 Tel 0191 515 2369\nFax 0191 553 5537 Email helenhortonsunderlandacuk\n', NULL), (4, '<NAME>', 'test', 'test', '', '1525893542050.jpg', NULL, 'Curriculum Vitae\nPersonal Data\nSurname first name\nAddress\nTelephone\nMobil\nDate of birth\nPlace of birth\nMartial status\nEmail\n<NAME>\nKastellstrae 1 65183 Wiesbaden Germany\n 49 0 611532 42 57\n 49 0 175 590 55 40\n08091978\nHanau Germany\nsingle\napotznerebssupplyinstituteor\nEducation\nsince 1004\nEuropean Business School ebs International University Schlo Reichartshausen\nOestrichWinkel Germany\nPostgraduate Assistant to the SVIEndowed Chair of Purchasing Logistics and Supply Chain\nManagement Supply Management Institute SMI\nStrive for the degree Dr rer pol April 2007\n1099 0504\n<NAME> GoetheUniversity Frankfurt Germany\nDegree in Business Administration DiplomKaufmann\nMajors Supply Chain Management Marketing Business Informatics\nGrade 18 passed with distinction\nGrade of diploma theses 10\n0889 0698 Kopernikusschule Freigericht Germany\nAlevels high school graduation\nGrade 22\nResearch Focuses Title of Dissertation\nFocuses\nInnovation management Supply chain management Aviation industry\nTitle\nTeaching\nsince 0306 Innovations along the Supply Chain\n0305 0605 Logistics Supply Chain Management\n0305 0605 Innovation management\nInnovation Management along the Supply Chain of the European Aviation Industry\nLecture\nCase Studies\nSeminar papers\nPublications\n1005\nJahns Ch and <NAME> Innovationskooperationen in der Supply Chain\nIn Blickpunkt Einkauf Logistik Forum Gelb GmbH October 2005\n0905\nJahns Ch and <NAME> Woher kommt eigentlich der Begriff Supply Chain Event\nManagement\nIn News und Trendletter Logistik Forum Gelb GmbH Vol 3 2005\n0705\n<NAME> Woher kommt eigentlich der Begriff BullwhipEffekt\nIn News und Trendletter Logistik Forum Gelb GmbH Vol 2 2005\n', NULL), (6, 'test', 'test', 'test', '', '1525959044513.jpg', NULL, 'Curriculum Vitae\nPersonal Data\nSurname first name\nAddress\nTelephone\nMobil\nDate of birth\nPlace of birth\nMartial status\nEmail\nPotz<NAME>\nKastellstrae 1 65183 Wiesbaden Germany\n 49 0 611532 42 57\n 49 0 175 590 55 40\n08091978\nHanau Germany\nsingle\napotznerebssupplyinstituteor\nEducation\nsince 1004\nEuropean Business School ebs International University Schlo Reichartshausen\nOestrichWinkel Germany\nPostgraduate Assistant to the SVIEndowed Chair of Purchasing Logistics and Supply Chain\nManagement Supply Management Institute SMI\nStrive for the degree Dr <NAME> April 2007\n1099 0504\n<NAME> GoetheUniversity Frankfurt Germany\nDegree in Business Administration DiplomKaufmann\nMajors Supply Chain Management Marketing Business Informatics\nGrade 18 passed with distinction\nGrade of diploma theses 10\n0889 0698 Kopernikusschule Freigericht Germany\nAlevels high school graduation\nGrade 22\nResearch Focuses Title of Dissertation\nFocuses\nInnovation management Supply chain management Aviation industry\nTitle\nTeaching\nsince 0306 Innovations along the Supply Chain\n0305 0605 Logistics Supply Chain Management\n0305 0605 Innovation management\nInnovation Management along the Supply Chain of the European Aviation Industry\nLecture\nCase Studies\nSeminar papers\nPublications\n1005\nJahns Ch and Pot<NAME> Innovationskooperationen in der Supply Chain\nIn Blickpunkt Einkauf Logistik Forum Gelb GmbH October 2005\n0905\nJahns Ch and <NAME> Woher kommt eigentlich der Begriff Supply Chain Event\nManagement\nIn News und Trendletter Logistik Forum Gelb GmbH Vol 3 2005\n0705\nPot<NAME> Woher kommt eigentlich der Begriff BullwhipEffekt\nIn News und Trendletter Logistik Forum Gelb GmbH Vol 2 2005\n', NULL), (8, 'Testing', 'tes@ddd', 'test', '', '1526063800675.jpg', NULL, 'yan\n<NAME>\nv<NAME> 7 Riese Pio X\n31039 Treviso Italy\n39 340 5997839\n385 92 2201317\nivangortolan Ogmailcom\nCurriculum Vitae\nSuccess is the ability to go from failure to failure without\nlosing your enthusiasm <NAME>\nInfo\nCitizenship Croatian\nBorn March 30th 1985 at Zagreb Croatia\nAddress Kutina Croatia\nLinkedIn httpitlinkedincomin\nAdditional JSalvadora 14 Ciglenica 44320\nDriving B\nLicense\nElance httpntrpelancecom\ngolvan\nBlog httpntrpivanblogspotcom\nSkype ivanntrp\nDesidered Employment and Current Skills\nSystem Administrator DBA Programmer Consultant\nOver the years thanks to my thirst for knowledge I have gained extensive experience in\ncomputer science ranging from operating systems to programming languages and platforms\nupon which the latter are based Along this path I have continued to improve my approach\nto problems always trying to implement optimal generalized and reusable solutions OOP\nDesign Patterns In some academic work opportunities Ive been able to demonstrate excellent\nteamwork skills and capability to collaborate with external groups Another virtue I possess is\nthe ability to solve almost any computer problem thanks to the excellent information gathering\nskills and the many years of experience in the compter science fheld\nComputer Skills\nLanguages JAVA JavaScript C C C SQL TSQL PHP ASPNET Jade HTML5 CSS3 LESS\nPYTHON LUA PERL BASH ATEX GLSL HLSL\nPlatforms Unix Linux Windows Windows Ser\nDB MySQL MSSQL MongoDB SSIS\nver IIS Apache Lighttpd Nginx\nNodejs Arduino\nTools VS2010 Eclipse IDE Netbeans IDE CMAKE Build system ANT Build system Git\nSVN Bzr Mercurial All NIX shell tools Direct3D 11 OpenGL 42 AJAX jQuery\nJSON Expressjs Socketio il8n Matlab Office Suite Photoshop Gimp AutoCad\nGoogle SketchUp Autodesk Maya\nExperience\nWorkin\n20092010 DBA System Admin Programmer Consultant GUS sr1 Venezia Italy\nWindows Server20082010 and MSSQL Server 20082010 administration creation and modi\nfication of TSQL stored procedures and SQL queries development of ASPNETC based\nwebsites development of C applications and general computer consultancy\n', NULL), (9, 'test', 'test@d', 'test', '', '1526065427880.jpg', NULL, 'CURRICULUM VITAE\nPROFILE\nLorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tem\nporincididunt utum labore eter dolore magna aliqua Ut enimad minimveniam\nquis nostrud exercitation ullconumlaborisnisiut aliquipexeacommodoconse\nEDUCATION\nMaster of Science in Electronics\nPolytechnic University of Moscow\nSep 2014Actually\nBachelor in Software Engineering\nPolytechnic University of Alabama\nNov 2010 Jun 2014\nWORK EXPERIENCE\nMARTIN SOLE\nGraphic Designer\nMay 2009Actually\nApr 2007 Mar 2009\nMay 2005 Aug 2007\nGraphic Designer\nConcept Design Studios LTD\nMedia Specialist\nMediaset Italia Rai Media\nBASIC INFORMATION\nChief Executive Officer\nEnvato Marketplaces Themeforest\nNationality\nBirthplace\nLiving in\nBirth Date\nGender\nCivil Status\nSWEDISH\nMALMO\nMUNICH\n150287\nMALE\nSINGLE\nCOMPUTER SKILLS\n1 Microsoft Office\nWORD\nEXCEL\nPOWERPOINT\nCONTACT INFORMATION\n2 Programming\nHTML5\nMob 015 69 5531 689\nFax 24 678 112 36725\nCSS3\nFOREIGN LANGUAGES\nfabiocimogmailcom\nmartinsolegmailcom\nCAE Certificate in Advanced English\nGrade A Points 92100\nLevel UpperIntermediate\n1 English\nVia Halit Kacanolli 342\nCopenhagen Denmark\nZMP Zentrale Mittelstufenprfung\nEuropian Framework Level C\nLevel Intermediate\n2 German\nSOCIAL NETWORKS\nfacebookcommartisole\nNo Diploma\nEveryday speaking and listening\nLevel Beginner\n3 Spanish\ntwittercommartinsoles\nSCAN QR CODE\nSKILLS INTERESTS\nMusic\nMovies\nThe Internet\nMedia Productions\nTraveling Experiences\n Creative Thinking\n High selfesteem\n Good communication skills\n Able to respect deadlines\n Good at teamworking\nMY PORTFOLIO\nBEHANCE\nfabiocimo\nDRIBBLE\nfabiocimo\nLINKED IN\nfabiocimo\n', NULL), (10, 'coba', 'coba@dd', 'coba', '', '1526065276403.jpg', NULL, 'SR\nSara Reynolds\n940 7466350 sarareynoldsgmailcom Chicago IL\nProfile\nConsectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore\nmagna aliq ua Ut enim ad minim veniam quis nostrud exercitation ullamco\nlaboris nisi ut aliquip ex ea commodo consequat Duis aute irure dolor in\nreprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur\nProfessional Skills\nProject Management O\nSEO Marketing\nContent Development O\nProject Management O\nProject Management\nSEO Marketing\nExperience\nContent Developer Acme Corporation\nMarch 2013 Present Virtual Position\nTechnical Skills\nConsectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et\ndolore magna aliq ua\nConsectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et\ndolore magna aliq ua\nConsectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et\ndolore magna aliq ua\nProject Management o\nSEO Marketing\nContent Development O\nSEO Marketing\nContent Development \nProject Management O\nContent Developer Acme Corporation\nMarch 2013 Present Virtual Position\nAdvertising\nProject Management O\nSEO Marketing\nContent Development eO\nProject Management O\nSEO Marketing\nContent Development \nProject Management O\nConsectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et\ndolore magna aliq ua\nConsectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et\ndolore magna aliq ua\nConsectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et\ndolore magna aliq ua\nContent Developer Acme Corporation\nMarch 2013 Present Virtual Position\nSocial Media\nProject Management O\nSEO Marketing\nContent Development \nProject Management O\nConsectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et\ndolore magna aliq ua\nConsectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et\ndolore magna aliq ua\nConsectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et\ndolore magna aliq ua\nContent Developer Acme Corporation\nMarch 2013 Present Virtual Position\nEducation\nUniversity of llinois Chicago\nEnglish\nConsectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et\ndolore magna aliq ua\n806509\n', NULL), (11, '<NAME>', '<EMAIL>', '$2b$10$1VpWpK6.e5x..B2wFFURTuaC68DCwAolkmIImSR0tjmkZe5Dc.Oq2', 'test', '1526139994350.png', '1526137436612.jpg', 'IMAGINATION\n', 'PROVINSI JAWA BARAT\nKOTA CIMAHI\nNIK\n3217061804870007\nARIEF WIJAYA PUTRA\nNama\nTempat Igl Lahir BANDUNG 1804 1987\nJenis kelamin\nAlamat JE AMIR MAHMUD GG\nLAKLEAKI\nGol Darah\nSIRNAGALIH NO 62\n005006\nRTIRW\nKelDesa\nKecamatan\nGBABAT\nISLAM\nPELAJARMAHASISWA\nCIMAHI UTARA\nAgama\nStatus Perkawinan BELUM KAWIN\nPekerjaan\nKewarganegaraanWN\nBerlaku Hingga SEUMUR HIDUP\n\nKOTA CIMAHI\n17112015\n'), (15, 'tang', '<PASSWORD>', <PASSWORD>', NULL, '1526067197983.pdf', NULL, 'Florida State University Master of Science in Finance Current GPA400 May 2015 Bachelor of Science in Finance and Real Estate May 2014 Bachelor of Science in Applied Economics May 2014 Minor in English Minor in Free Enterprise Ethics State Board of Administration of Florida Tallahassee FL Private Equity Intern May 2014 Present Assist in due diligence analysis of new investments including buyouts venture capital growth equity secondary sales and coinvestments Gather data and update Microsoft Excel models based on performance of private equity funds Maintain organization of connections presentations and valuations of firms in portfolio Publish FSBA Private Equity weekly update booklet tracking investment process calendar meeting notes fund overviews and deal log FSU New Student Family Programs Tallahassee FL Administrative Assitant January 2013 May 2014 Implemented efficient checkin process for 16000 family members and students Managed and processed incoming payments of high volume Coordinated across all executive departments of FSU for successful orientation presentations Interacted with incoming students and their family members regarding transitions FSU New Student Family Programs Tallahassee FL Orientation Leader November 2011 January 2013 Directed welcome presentations in order to acclimate 150 new students Provided extensive knowledge and resources to generate a comfortable transitional environment for new students and their families Collaborated with 36 other Orientation Leaders in order to meet the goals of the professional staff Urban Land Institute May 2014 Present Attend summits and meetings regarding how Real Estate can better communities The International Council of Shopping Centers October 2013 Present Student exposure to deal making events for commercial Real Estate industry FSU Real Estate Society Director of Women in Real Estate January 2013 Present Create a peer to peer mentorship program for professional students Develop professional goals through presentations Former Tresurer organized dues and made payments for success of society Alpha Chi Omega Alumnae Member October 2011 Present Beta Eta Chapter Florida State University Memberships Experience Tallahassee FL Education Sydney Krier 3260 Hidden Lake Dr E Jacksonville FL 32216 skk10cmyfsuedu 904 4513844 Perspectives on Free Enterprise Relevant Coursework Bloomberg Certification In Process LicensingImportant Skills Advanced Microsoft Excel Econometrics Modeling Applied Econometrics in Finance Problems in Financial Management ARGUS Valuation Certification Real Estate Finance and Investments ', NULL), (16, 'Demo Member', '<EMAIL>', <PASSWORD>', NULL, '1526101774599.jpg', NULL, 'PROVINSI JAWA BARAT\nKOTA CIMAHI\nNIK\n3217061804870007\nARIEF WIJAYA PUTRA\nNama\nTempat Igl Lahir BANDUNG 1804 1987\nJenis kelamin\nAlamat JE AMIR MAHMUD GG\nLAKLEAKI\nGol Darah\nSIRNAGALIH NO 62\n005006\nRTIRW\nKelDesa\nKecamatan\nGBABAT\nISLAM\nPELAJARMAHASISWA\nCIMAHI UTARA\nAgama\nStatus Perkawinan BELUM KAWIN\nPekerjaan\nKewarganegaraanWN\nBerlaku Hingga SEUMUR HIDUP\n\nKOTA CIMAHI\n17112015\n', NULL), (17, 'Budi', '<EMAIL>', <PASSWORD>', NULL, '1526111952152.png', NULL, 'yan\nGreguri Ortolan\nvia Palazzon 7 Riese Pio X\n31039 Treviso Italy\n39 340 5997839\n385 92 2201317\nivangortolan Ogmailcom\nCurriculum Vitae\nSuccess is the ability to go from failure to failure without\nlosing your enthusiasmWinston Churchill\nInfo\nCitizenship Croatian\nBorn March 30th 1985 at Zagreb Croatia\nAddress Kutina Croatia\nLinkedIn httpitlinkedincomin\nAdditional JSalvadora 14 Ciglenica 44320\nDriving B\nLicense\nElance httpntrpelancecom\ngolvan\nBlog httpntrpivanblogspotcom\nSkype ivanntrp\nDesidered Employment and Current Skills\nSystem Administrator DBA Programmer Consultant\nOver the years thanks to my thirst for knowledge I have gained extensive experience in\ncomputer science ranging from operating systems to programming languages and platforms\nupon which the latter are based Along this path I have continued to improve my approach\nto problems always trying to implement optimal generalized and reusable solutions OOP\nDesign Patterns In some academic work opportunities Ive been able to demonstrate excellent\nteamwork skills and capability to collaborate with external groups Another virtue I possess is\nthe ability to solve almost any computer problem thanks to the excellent information gathering\nskills and the many years of experience in the compter science fheld\nComputer Skills\nLanguages JAVA JavaScript C C C SQL TSQL PHP ASPNET Jade HTML5 CSS3 LESS\nPYTHON LUA PERL BASH ATEX GLSL HLSL\nPlatforms Unix Linux Windows Windows Ser\nDB MySQL MSSQL MongoDB SSIS\nver IIS Apache Lighttpd Nginx\nNodejs Arduino\nTools VS2010 Eclipse IDE Netbeans IDE CMAKE Build system ANT Build system Git\nSVN Bzr Mercurial All NIX shell tools Direct3D 11 OpenGL 42 AJAX jQuery\nJSON Expressjs Socketio il8n Matlab Office Suite Photoshop Gimp AutoCad\nGoogle SketchUp Autodesk Maya\nExperience\nWorkin\n20092010 DBA System Admin Programmer Consultant GUS sr1 Venezia Italy\nWindows Server20082010 and MSSQL Server 20082010 administration creation and modi\nfication of TSQL stored procedures and SQL queries development of ASPNETC based\nwebsites development of C applications and general computer consultancy\n', NULL), (18, 'andi', '<EMAIL>', <PASSWORD>', NULL, '1526111965232.jpg', NULL, 'CURRICULUM VITAE\nPERSONAL INFORMATION Palmina Mancino\n19 Monle Circeo rd Rome RM Italy Postoode 00141\n39 0560863147 39 3289456979\nSkype paminamancino\nSex Female Date of brth 12 April 1981 Natonality Italian\nPharmaceubical chemist ipharmacist\nJOB APPLIED FOR\nWORK EXPERIENCE\nSeptember 2006 March 2007 Stage\nRonchi Pharmacy Snc Dr Cantarella e Dr Marteli\n2 Ronchi Square 00177 Rome Italy\nSixmonth intenship done at University\nEDUCATION AND TRAINING\nMember of the Order of Pharmacists in Rome\n15 <NAME> rd 00161 Rome Italy\nJanuary 2013\nNovember 2000 October 2012 Bachelor of Pharmaceutcal Chemistry and\nTechnology\nFacuity of Pharmacy and Medicine\nLa Sapienza University Rome Italy\naddress analytical chemistry\nthesis of Bachelor in Dnamic HPLC dromatograph\no ganic chemistry Prlessor <NAME>\nSeplember 1995July 2000 Diploma in Accounting and Commercial Expert Programmen\nState Techical Institute Leopoldo Pila 21V Veneto rd 86100 Campobasso Italy\nItalian language\nForeign language English and French\nDecember 2007\nEuropean Computer Driving Licence ECDL\nLa Sapienza University Rome Italy\nPage 1 12\n', NULL), (19, 'yeni', '<EMAIL>', <PASSWORD>', NULL, '1526111977173.jpg', NULL, 'JeanMarc IMELE\n37 rue de lOrme Saint Edme\n95130 FRANCONVILLE\nPhone 330134140691\nMobile 330644278821\nEmail imelejmgmailcom\nBlog wwwjim3dblogspotcom\nBom 03051989 23 years at PlessisBouchard\nDriving license\nFRANCOITALIAN NATIONALITY\nFORMATION\nraduate in 3D Animation\nLISAA LInstitut Suprieur des Arts Appliqus\n20092012\n1st year of TUD Technical University Degree Marketing Techniques\nUniversit de CergyPontoise\n20082009\nHighschool Diploma emphasing on Economic and Spanish\nwith Honors\nLyce Gnral et Technologique dErmont\n20072008\nPROFESSIONAL EXPERIENCES\nJuly 2012\nMarch 2012\nDecember 2011\nJanuaryMay 2011Rigger Animator on the student short 3D animation film\nRigging Setup quadrupedes and props SupamonkS Studio\nRigging Setup on Lherbier a 3D animation film LISAA\nRigger on the student short 3D animation film Pingouins3 \n CourtCircuit screened at the Cairefour de lAnimation 2011 \nSKILLS\nEnglish college level\nSpanish college level\nItalian read and write especially the Neapolitan dialect\nLanguages\nSoftwares\nAutodesk Maya Adobe After Effects Photoshop Premiere\nHoBBIES\nSports\nSwimming 5 years football 13 years FFF mountain bike\nVarious\nCinema music sport reading\n', NULL), (20, 'pabou', '<EMAIL>', <PASSWORD>', NULL, '1526111986461.png', NULL, 'PERSONAL DETAILS\nName\nPlace and Date of Birth\nSex\nAddress\nMarital Status\nTelephone Number\nEmail\n<NAME>ih\nSurakarta 19th December 1989\nFemale\nJalan Srinarendro No 18 Solo\nSingle\n0271713130085647183000\nmillykhahotmailcom\nEDUCATION\nJanuary 2012\nBachelor Degree of Economic at Universitas Sebelas Maret\nMajor\nGPA\nFinished Senior Highschool SMAN 7 Surakarta\nFinished Junior Highschool SLTP N 9 Surakarta\nFinished Primary School SD Tamirul Islam Surakarta\nManagement\n319\n 2007\n 2004\n 2001\nOTHER SKILLS\nMicrosoft Office\n Internet literacy\n Active English with TOEFL ITP Score\n553\nWORKING EXPERIENCE\nEnglish Teacher at Aisyiyah ABA Baron Kindergarten\nInternship at PT Danar Hadi Export Division as Marketing Staff\nAcer Redemption Staff at APKOMINDO Expo Solo\nFreelance at Rp7 Communication and Advertising\n2011 Present\nFebruari 2011\n2010 Present\n 20102011\nORGANISATIONAL EXPERIENCE\nDesember 2010\n 20092010\n 20082009\n2007 2010\nProducer of PENTAS PANAS Teater Gadhang FE UNS\nSecretary of Teater Gadhang FE UNS\nProduction staff of Teater Gadhang FE UNS\nTutor of Nusa Indah illiteracy learning group\n', NULL), (21, 'testing', '<EMAIL>', <PASSWORD>$<KEY>', NULL, '1526115431607.jpg', NULL, 'PROFILE\nI am an experienced social media manager seeking a fulltime\nposition in the field of social media and marketing communications\nwhere l can apply my knowledge and skills for continuous\nimprovement\nEXPERIENCE\nSOCIAL MEDIA PRODUCER\nNEW MEDIA COMPANY FEB 2013DEC 2014\n Managed social media accounts and created social media for\ndaily postings\n Increased social media following and clicks by 200\nMAXENE\nWOOLFOLK\nCOMMUNICATIONS INTERN\nRICH MEDIA INTERACTIVE 1 APR 2012 JAN 2013\n Developed a social media strategy to increase the following of\nthe company website\nSpearheaded a viral campaign for one of the companys new\nproducts\nSOCIAL MEDIA MANAGER\nEDUCATION\nBACHELOR OF ARTS MAJOR IN COMMUNICATION\nUNIVERSITY OF DUNDEE 2009 2013\nGPA 39\nCONTACT\n44 7700 9530\nHELLOMAXENEWOOLFOLKCOM\nW WW MAXENEWOOLFOLKCOM\nSKILLS\n SEO and Google Analytics\n Social media strategy\n Marketing\n Corporate blogging\n Project management\n Layout design\n Photo editing\n Market research\nWeb content development\nSOCIAL MEDIA\n Copywriting\nTWITTER MAXENEWOOLFOLK\nFACEBOOK MAXENEWOOLFOLK\nINSTAGRAMMAXENEWOOLFOLK\nAWARDS\nNEW MEDIA COMPANY\nMOST OUTSTANDING SOCIAL MEDIA PRODUCER\nDEC 2015\nRICH MEDIA INTERACTIVE\nBEST INTERN\nJAN 2014\n', NULL), (22, 'dani', '<EMAIL>.com', '$2b$10$Kz1wwsMKnWK.OnR1hkxtNeyZ/RkKynJSdo0CixPAwnvjZxXW3Ric6', NULL, '1526116698476.png', NULL, 'Summary\nAbout Im a hardworking and dedicated person love to explore always have\nbig hunger for naw knowledgeI lowa to inspire other paople around me and get\nnspired by themOptimist for lite\nZodiac Sign Aquarius\nTUNG LAM\nInterestsi Gultar Street photography Carting RowingRending Blogging\nObjectivest Applying for Androld Nobile Developer\nNGUYEN\nWebMobile Developer\n<NAME>\n5 github comtinguyencom\nin inkedincomintunglamnguyen\nWork History\nMay 2015 Android Develaper\nPresent Mentor<NAME>\nMar 2014 Web Developer\nJun 2014 Barely5th Design Studio\nIve been morking on a col startup about fnancial education\nSkills\nIts now on prhate beta stage and was featured at several\nAndroid Development\nhttpilbetallstcomstertupslgrowbscon\nhttplstartupdopecomgrowbacoiew\nhttpwwwsuparbcrewcomgrowbaconbeachyourkidsabour\n2 weeks study experience at\ninvestmentssavingsandloan\nDevelopmant study at MenberMabe\nAcademy\nHybrid Mobile Development\nAug 2013 Sftware Developer\nFeb 2014430 PM Ltd\n4 months mbxed professional and\nstudy experience on Hybrid Mobile\nDevelopmant using\nIve been working with IBM WebSphere Message Broker It works\nas an Intsgration Engine betwsen different hospitals in UKmy\njob was to develop the interfaces eeded for manipulating the\neschanged messages between ell the applications from the\nhospitals\nAnguiarjs\nlonic\nOct 2012\nJul 2013\nJunior Java Developer\nBouygues Construction IT Center in Vietnam\nIve been working on two projects during this time\nObjectiveC and ios\nDevelopment\nESAW During this project Ihed to upgrade Its old version It w\nwritten with java Serviet and JSP with no framework support at\nal I was the project owneranalyzer working with 2 of my\ncolesgues on the team my job mas to integrate the new desigr\nfusion of al the databases to work in one sppication and\nimplementing new features by the costumers desires\n2 weeks study experience t\nTelerikAcademy\nWindows Universal\nDevelopment\nGroupieThis project is one of our company tools the working\ncode was too old so we decided to rewrite the whole project\nfrom the scratch We used Struts 2 framework for this purpose\nOur team was consisted of 3 people I was working at the lower\nlevel of tha project providing the API to othar devalepers 5\nthey can handle the GUL and use my AP to load the data to the\napplication\n2 weeks study experience ot\nJavaJavaEE Technologies\n1 year professional skil working on\nvarious technology frameworks and\nprogramming concepts ske\nEducation\nOOP Princ ples\nDesign Pettems\nSOLID\nDataStructures and Algorithms\nStruts 2\nSpring MWC\nHibemte\nNov 2014 Academic\nFeb 2015 MentorMate Academy\nOct 2013 Academic\nNov 2014 TelerikAcademy\nAug 2008\nAug 2012\nBachelor of Engineering BEng\nTechnical University Sofia\n', NULL), (23, 'beni', '<EMAIL>', <PASSWORD>', NULL, '1526116707389.jpg', NULL, 'lin work Experience\nUVUX Designer Academy\nAN 2013 DEC 2013\nLorem ipsum dolor sit amet consectetur adipiscing elt sed do eusmod tempo\nncididunt ut labore st dolore magna aliqua\nar\nCreative Director deviserweb\nLerem ipsurn dolor st net consecteur\nergeltsed de eurod tempor\nLorem psum dolor st amet\nconsectetur adioiscing elt sed do\neusmod tempor incieidunt ut\nlabore et dolore magna aliqua Ld\ndo eusmod tempor incididunt ut\nlabore et doiore magna aliqua\nncididunt ut labore et dolore magna alqua\nGraphics Designer creative Wold\nLonem ipsum dolor sit amet conpectetur adipiscing elt sed do elusmod tempor\nncididunt ut labore et dolore magna alqua\n 1113334444\nmobile\n1213233494\nwork\nEducation\nArtMultimedia goxford University\nAN 2013DEC 2013\nLonem psum dolor st amet consectetur adipiscing eit sed do elusmod tempor\nnoididunt ut labore et dolore magna alqua\nmailalrayhancom\nwork\nPost Graduation gorem\nJAN 2013DEC 2013\nLorem Ipsum dolor sit amet consectetur adpiscing elt sed do elusmad tempor\nncididunt ut labore et dolore magna alqua\n\n24 Golden Tower and foor\n24 Colden Tower Cied tool\nAmborkhana Sylhet\nSYL 3RFS7W\nTTMP Degree creative School\nJAN 2013DEC 2013\nLorem ipsum dolor sit amet consectetur adipscing elit sed do elusmod tempor\nhoididunt ut labore et dolare magna alqua\nProfessional Sklls\nAdobe Photoshop\nHTML\ncss\nInterestes\nPHP\nAVA\nSQL\nwwwdribblecomrtralrayhan\n', NULL), (24, 'sandy', '<EMAIL>', '$2b$10$Kz1wwsMKnWK.OnR1hkxtNeyZ/RkKynJSdo0CixPAwnvjZxXW3Ric6', NULL, '1526116715888.jpg', NULL, 'JOHNNY\nALEX SMITH\nSenior Website\nDesigner\nHome 555 5555555\nCell 555 1234321\nEmail kukookcomgmailcom\nWebsite wwwkukookcom\nAddress Street 2 Hawaii\nTwitter KukookResumes\nWORK EXPERIENCE\nLEAD WEB DESIGNER Kukook International 2013 CURRENT\nPrimary responsibilities include User Interface Designs utilizing Photoshop lllustrator Dreamweaver HTML CSS and JQuery\nSignificant amount of Browser Compatibility Testing and debugging Mobile website development including responsive web\ndesign techniques for compatibility on both mobile phones and tablets Extensive use of Content Management Systems\nincluding Wordpress and Drupal Ecommerce configurations setups and designs utilizing enterprisesized software and\ncontent management systems\nFREELANCE DESIGN CONSULTANT Kukook LLC 2011 CURRENT\nDesigned developed and maintain an ecommerce website for a local retailer This project started with an initial completion\ndate but ended up staying hired part time for maintenance and product listings in my spare time\nEDUCATION\nMASTERS IN GRAPHIC ARTS Kukook State University May 2013\nFocus on typography and color theory web and media design in the modern age\nBACHELOR OF ARTS IN GRAPHIC DESIGN Kukook State University May 2013\nFocus on graphic design software photo manipulation and web development practices\nPROFESSIONAL SKILLS\nAdobe Photoshop\nAdobe llustrator\nDreamweaver\nHTML CSS\nBranding\nContent Management\nJavascript\njQuery\nABOUT ME\nMy name is Johnny a Web Developer and\nGraphic Designer I am looking to obtain a\nposition within a challenging and dynamic\nenvironment that will enable me to use my\nstrong organizational skills\neducational background\nand technical expertise\nThank you for your\nconsideration in this\nopportunity and I look\nforward to hearing from you\n', NULL), (25, 'sherni', '<EMAIL>', <PASSWORD>', NULL, '1526116730527.png', NULL, 'Summary\nHey there My names Chris Im your local linux\nenthusiast web developer cyclist travel bug anime fan\nand serial entrepreneur addicted to making cool stuff with\nawesome people\nCHRIS BOLTON\nSenior Software Engineer\nLos Angeles CA\nogchrisboltonme\n157873660\nSkills\nIve been working with various companies and startups\nover the past four years and am an experienced fullstack\nweb developer Ive ta ken on roles that include quality\nassurance engineering frontend web development mobile\ndevelopment backend database work and linux server\nedministration\nEmberjS\nIm always on the lookout for awesome workplaces with\nstrong engneeringdriven culture to connect with and\npossibly be a part of and help grow I leam very quickly\nand am always excited for whatever comes my way\nAngularj5\nHTMLSCSS3\nWork History\nLinux Server Administration\nDec 2013Lead Developer\npresentEatt\nLaunching my own side project while freelancing in an industry\nIm passianste about with awesome teammates\nhappen\nJavascript\nMaking it\nRuby on Rails\nec 2012\nSoftware Engineer\nRuby\nHelped add some engineering power to the team during the\ncompanys push for their new GraphEfect 30 platform\nun 2012Frontend Engineer\nec 2012\nSurf Air\nBrought aboard as the second engineering hire and responsible\nfor all frontend development of Surf Airs website and mobile\napps\nct 2011 Quality Engineer\nMay 2012 mFoundry\nWas brought on board to help lead automation and load\nbalancing efforts on mFoundrys mobile platform Also handled\nlot of the server management work and some of the lowenleve\ndebugging issues required in the Q4 department\nPortfolio\nat Heping people lead healthier Ives with complete personalized meal\nplans lusheven herpluappcomA highend real estate marketplace\n', NULL), (26, 'kevin', '<EMAIL>', <PASSWORD>', NULL, '1526116739168.png', NULL, 'BRYCE HAMMOND\nIOS DEVELOPERSOFTWARE WIZARD\nDenver cO\nIntent\nSkills\nAn Apple Design Averd winning developer wart to create exceptional\napps balancing innovative interaction and visual design I have\nextraordinary attertion to detail and create scalable and elegant\nObjectiveC Swift \nCocoa\nWork History\n0s and OS X Development\nwith ObjectiveC Swift and\nCocoaCocoaTouch\nFeb 2011Lead Programmer Magician\npresent s\nMobile Development lead and head developer for the CIC\nolowing apps\neDiscovery Assistant app and Rals APO\nWis a Voy app and Rails AP\nOpto created framework so client could create\nnew exercises via configuration files\nFeedback Sports app and Rails API\nePantry ePantry now maintains it previously 5\nstar rated\nSnowaoom and 5SCW app and Rals AP\nCOPD\nEnterprise apps for Stanford University and\nLarge scale and high\navailability system\nexperience in C and C\nMagic\nPocket Consultant Guide\nspecialicing in card and coin\nmagi with eriginal effects\ncrested that integrate\ntechnology\nOthers yet to b released\n Built and maintained backend in C for\nJscobsen and MAI Network\nParfomed the occasional and somstimes original\nmagi trick for coleagues and clients\nRuby Rails\ncontrol system to Mercurial and then to Git\nul 2007Software Engineer\nFeb 2011 Wall Street on Demand Markit on Demand\nRuby and Rulby on Rails\napplication development\nTeam lead architect and lead developer for the team\nresponsible for creating the following iPhonePad\nVersion Contro\nRnancial Times\nFinancial Times iPad Edition won Apple Design\nExperience with Git\nSubversion CVS Mercurial\nv sual SourceSafe lyep\nsaid t and Rational\nward in 2010\nTD UK NatwestRBS\nOther apps that have gone way downhill since I left\nl need a beer\nC NET\nDaily use of Objective C C Perl Ruby and SOL\nWork on high avslablity highly scalable Windows\nbased backend serwer systems that service most\nevery major financial website CNBC Scottrade\nAmeritrade Schwab etc\nDesigned and coded a tool to streamline XML feed\nIntegration drastically reducing the time needed to\nExperience with NET MVC\nWebforms Console\nWPF applicationsand\nCreated a tool to automatically transition the Viual\nSourceSafe version control system to Subversion\nwhile maintaining version istory\nDevelop and maintain systems handing thousands of\nantainn Control syst eransition the Vsdsclications anaoplictians\n', NULL), (27, 'martin', '<EMAIL>', <PASSWORD>', NULL, '1526116747015.jpg', NULL, 'Qiesto Eliano\nPHP WORDPRESS PROGRAMMER\nNapoli revenue Elsadore str 23 Mob 946 31586973wwwelianowebsitecom elianomailcom\nLorem ipsum dolor sit amet consectetuer adipiscing elit Maecenas\nporttitor congue massa Fusce est Vivamus a tellus\nFusce posuere magna sed pulvinar ultricies purus lectus malesuada libero\nsit amet commodo magna eros quis urna Nunc viverra imperdiet enim\nCareer Objective\nDynamic Data Manager\nBig wordpress Project\nExperience\n2003 2005\nLorem ipsum dolor sit amet consectetuer adipiscing elit\nMaecenas porttitor congue massa Fusce posuere magna\npulvinar ultricies purus lectus malesuada libero sit amet\ncommodo magna eros quis urna\nSenior Hjax Programmer\nProject For very Big company\n2005 Present\nLorem ipsum dolor sit amet consectetuer adipiscing eliMaecenas\nFusce posuere magna sed pulvinar ultricies purus libero\namet commodo magna eros quis urna Nunc viverra imperdiet\n\ne Fusce est Vivamus a tellus\nPHP Language\nLorem ipsum dolor sit amet consectetuer adipiscing elit Maecenas\nporttitor congue massa Fusce posuere magna sed pulvinar ultricies purus\nlectus malesuada libero sit amet commodo magna eros quis urna\nTechnical Skills\nAjax Language\nLorem ipsum dolor sit amet consectetuer adipiscing elit Maecenas\nporttitor congue massa Fusce posuere magna sed pulvinar ultricies purus\nlectus malesuada libero sit amet commodo magna eros quis urna\nNunc viverra imperdiet enim Fusce est Vivamus a tellus\nHTML5\nLorem ipsum dolor sit amet consectetuer adipiscing elit Maecenas\nporttitor congue massa Fusce posuere magna sed pulvinar ultricies purus\nlectus malesuada libero sit amet commodo magna eros quis urna\nNunc viverra imperdiet enim Fusce est Vivamus a tellus\nEducation Very Big University\nDiplomats Web Programing SEO Optimization\nLorem ipsum dolor sit amet consectetuer adipiscing elit Maecenas\nporttitor congue massa Fusce posuere magna sed pulvinar ultricies\npurus lectus malesuada libero sit amet\nFor Cl\nCom\n', NULL), (28, 'surya', '<EMAIL>', <PASSWORD>$Kz1wwsMKnWK.OnR1hkxtNeyZ/RkKynJSdo0CixPAwnvjZxXW3Ric6', NULL, '1526116755260.png', NULL, 'SHEEHAN ALAM\nWork History\nAcademic Papers\nProgrammer Analyst\nAmerican Express\nDeveloping corporate payment biling systems\nAgile Software Methods\nApplied To The Deployment\naf a Content Management\nSep 2005\nTechnical Marketing Engineer\nJan 2008 httpwwwintelcom\nproduct famly\nPDF\nPentium\nCore 2 Quad\nJan 2005 Software Engineer\nSep 2007 htwwwintercom\nThesis documenting the\nsage of agile software\n3D mechanical modeling tool\nChip design repository\nPower delivery and analysis tools\nBlogs\nThe Fratboy\nInvestorPersonal finance\nand investing tips for folks in\nMay 2003\nSoftware Engineer\nttpwwwwhoneyweWcom\nDeveloped charting component for vibration analysis\ntheir twenties\nPerfomed business analysis on standardiaing\nTechnology and linux tips\nSummary\nam currently availsble for\ncorporate level inventory system\nEducation\nBachelor of Science\n2007\nGo Sun Devils\nCharitable\nEvents\nBeards fer Bangladesh\nOne of the original members\nSkills\nraising money for orphans\nMarch of\nAndersen Junior High School\nMFC GCC STL\nWeb Design\nAAX JavaScript CSS HTML Dreamweaver Frontpage Drupal WordPress\nDatabase\nA concept from 2007 to\non me\nitem price and proximity\nConsulting\nASU Polytechnic\nSQL Server BM DB2 MySQL PostgreSOL\n', NULL), (29, 'Louis', '<EMAIL>', <PASSWORD>3Ric6', NULL, '1526116762554.png', NULL, 'Summary\nHello World\n<NAME>\nESPINOSA\nI am a passionate programmer who loves to be in the\name industryI been involved in multiple production in\nthis awesome industry with amazing teams\nGuadalajara Area Mexico Mx 14\nomer vodevgmailcom\n3338159456\nin inkedin comupubromar ramos\naspinosa3657b868\nSkills\nWork History\nul 2013Programmer\n2014 Larva Game Studios\nMay 2012 Videogame Developer\nul 2013Fraktalia Studios\nGamer\nGame Development on smartphones and tablets doing\ngameplay and social integration\nSelftaught person\nSep 2011 Junior Programmer Mobile Games Area\nMay 2012 Kaxan Media Group Kaxan Games\nGame Development on smartphones and tablets\nLeader\nJan 201Junior Quality Assurance Testing\nMay 2012Kaxan Media GroupKaxan Games\nGame Programming\nGama is tesbed to chack that doeant contain bugs gameplay\nemorsvisual errors etc\nGame Development\nEducation\nan 2010 Student\nan 2012 Universidad de Artes Digitales\nMath\nA Game Devalopment Engineer is a specialist to assist in the\nprocess of developing entertainment technology it makes useof\nmathematicel know edge for the application of artificial\nIntelligence and graphics processing on consoles computers\nGameplay\nmobile devices\nUnity3D\nSpirits Of Spring IOs Unity3D\nUnreal Engine 3\nChiwatin a young Native boy stranded in the northern landscapes of Permanent\nWinter is haunted by oant crows To owercome their cruelty Chiwatin goes onan\nnspiring quest to restore Springtime and fied the courage to move on\nGameplay\nSPRING\nLaunch Traler\n', NULL); INSERT INTO `hunters` (`id`, `name`, `email`, `password`, `bio`, `cv`, `ktp`, `cv_raw`, `ktp_raw`) VALUES (30, 'kamal', '<EMAIL>', <PASSWORD>', NULL, '1526116770941.jpg', NULL, 'ANTREAS ANTONIOU\nCOMPUTER ENGINEERDATA SCIENTIST\nSummary\nSkills\nMy nae i Ant<NAME>1 ams very passicnate about research in\nData Wsulisation Skills\nuch have always been top of my tlas and then chose to becem an\nungineer Eventuaty i graduated as a computer systems engineer which\n degree that composed of half electronand hat computer science\nmodules which enabled me to tackle probiems iisolving both scences\nAfter ar excallert third year in which Q\nmanaged to tnish with 16 4 trong 2 1 which was 0224 off from Embedded Systems\nbeing a first Ater being expased to research at my fial yea projectEngineering and\nmatplotib R and\nugpkx2pkt 3D\nt 86 in my final dissertation\nbedded systems course and summer rosearch Iemship in\nProgramming\nhe eg Becase ed my love far robots afid the facz that they\nan extremey mutti disciplined subject wrech rworves all the subjects\nove I decided to become an expert inubtics and artificial neligenc\nRobets hve thu potential to trasfore our world and lves Dy eplering\nEmbedded Systems\nEngiveerig Experierce s\noceans improving our cities and lives or even toking us up to the\nstars I nant to be part of thaeffert lo help advance wierce hurmanity\nand generaily our world through research in robotics\nprogr 5mming drectly on\nhardware and experience in\nprogramming low level\npistformms such as Arguing\nasplberry PP\nmicrocontroilersand Am\nhosed microcontrolle\nElectronics\nEngineering\nWork History\nSaftware Programmer\nLANCASTER UNIVERSITY\nt was selected by s large amount of students to be\nsotmane engineering Ptons through a Lancaster\nUnlversity Summer inkemship progrom in which I had to\ndesign implemert lest and finsize a system The\nSystem had to be able of letting mobile devices\ncommunicate with server in order to rreste s muttie\nntegrated Circus\nEngrNerina Haawae\nDesign Look st Employment\namount of users and aiso support a chat engina betwaen Section Snial Processirg\nusers and server The end product hed met ond\nAdvarced Electronics Thoory\nKnowiedge Digtal\nElectronics Engineeing\nxceaded iritial targets set by the supervises\noct 20145oftware Developer\nDec 2014 NFOLAG21GRADUATE ACADEMY\nManagement Skil\nI worked in the Strotegit Innovation Support Program n\npplication\nThe aop when completed was able to\nTesm Management Skill\nnabled by a predetermi ned phone share\nand ther it woud sond\nor wudig and transmit the GPS coordinstes ys email to\npreselcted contacts in case of dangerin a\nthe optlon to be preset to onsble it\nalter a speciied timeframe had the user not disotbied the\nS M5 messages recand dSoftware Engineering\nSkills\naddition it hadn\nvice Ths was done in 1 5 morith reaching and\nceeding the supervisors intisl objectives The\nNcwfks Programming\nKnowledge and Experience\nprovided troughout the next 3 months to alow the\ncompeny bomanage the opp and its statiszics\nAndroid Development\nDistributed Systems\nDevelopment ava RMI\nGroups P2P ReST Lost\nChordNodes\nul 2014 Embedded Systems Research inten\nSep 2014 MFOLAB21COMPUTNG AVD COMMUNICATIONS\nDEPARTMENT\nt was handpicked by one of my professors to design\nData MiningMachine\n', NULL), (31, 'arief <NAME>', '<EMAIL>', <PASSWORD>', NULL, '1526195710761.jpg', '1526195680506.jpg', 'PROFILE\nI am an experienced social media manager seeking a fulltime\nposition in the field of social media and marketing communications\nwhere l can apply my knowledge and skills for continuous\nimprovement\nEXPERIENCE\nSOCIAL MEDIA PRODUCER\nNEW MEDIA COMPANY FEB 2013DEC 2014\n Managed social media accounts and created social media for\ndaily postings\n Increased social media following and clicks by 200\nMAXENE\nWOOLFOLK\nCOMMUNICATIONS INTERN\nRICH MEDIA INTERACTIVE 1 APR 2012 JAN 2013\n Developed a social media strategy to increase the following of\nthe company website\nSpearheaded a viral campaign for one of the companys new\nproducts\nSOCIAL MEDIA MANAGER\nEDUCATION\nBACHELOR OF ARTS MAJOR IN COMMUNICATION\nUNIVERSITY OF DUNDEE 2009 2013\nGPA 39\nCONTACT\n44 7700 9530\nHELLOMAXENEWOOLFOLKCOM\nW WW MAXENEWOOLFOLKCOM\nSKILLS\n SEO and Google Analytics\n Social media strategy\n Marketing\n Corporate blogging\n Project management\n Layout design\n Photo editing\n Market research\nWeb content development\nSOCIAL MEDIA\n Copywriting\nTWITTER MAXENEWOOLFOLK\nFACEBOOK MAXENEWOOLFOLK\nINSTAGRAMMAXENEWOOLFOLK\nAWARDS\nNEW MEDIA COMPANY\nMOST OUTSTANDING SOCIAL MEDIA PRODUCER\nDEC 2015\nRICH MEDIA INTERACTIVE\nBEST INTERN\nJAN 2014\n', 'PROVINSI JAWA BARAT\nKOTA CIMAHI\nNIK\n3217061804870007\nARIEF WIJAYA PUTRA\nNama\nTempat Igl Lahir BANDUNG 1804 1987\nJenis kelamin\nAlamat JE <NAME>AHMUD GG\nLAKLEAKI\nGol Darah\nSIRNAGALIH NO 62\n005006\nRTIRW\nKelDesa\nKecamatan\nGBABAT\nISLAM\nPELAJARMAHASISWA\nCIMAHI UTARA\nAgama\nStatus Perkawinan BELUM KAWIN\nPekerjaan\nKewarganegaraanWN\nBerlaku Hingga SEUMUR HIDUP\n\nKOTA CIMAHI\n17112015\n'); -- -------------------------------------------------------- -- -- Table structure for table `hunter_vacancy` -- CREATE TABLE `hunter_vacancy` ( `hunter_id` int(11) NOT NULL, `vacancy_id` int(11) NOT NULL, `result` text, `score` double DEFAULT NULL, `reason` text COMMENT 'Buat kasih Feedback', `feedback` text ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `hunter_vacancy` -- INSERT INTO `hunter_vacancy` (`hunter_id`, `vacancy_id`, `result`, `score`, `reason`, `feedback`) VALUES (1, 7, '{"gender":1,"gpa":0,"skill":[0,0,0],"id":"1"}', 20, 'We are sorry, you are not meet the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (2, 7, '{"gender":1,"gpa":1,"skill":[1,0,0],"id":"2"}', 60, 'We are sorry, you are not meet the html skill, and the css skill.', 'Your skill barely meet the requirement. Please study more than the others'), (11, 7, '{"gender":1,"gpa":0,"skill":[0,0,0],"id":"11"}', 20, 'We are sorry, you are not meet the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (16, 7, '{"gender":1,"gpa":0,"skill":[0,0,0],"id":"16"}', 20, 'We are sorry, you are not meet the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (17, 7, '{"gender":1,"gpa":0,"skill":[1,0,0],"id":"17"}', 40, 'We are sorry, you are not meet the GPA requirement, the html skill, and the css skill.', 'Your skill barely meet the requirement. Please study more than the others'), (18, 7, '{"gender":1,"gpa":0,"skill":[0,0,0],"id":"18"}', 20, 'We are sorry, you are not meet the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (19, 7, '{"gender":0,"gpa":0,"skill":[0,0,0],"id":"19"}', 0, 'We are sorry, you are not meet the gender requirement, the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (20, 7, '{"gender":0,"gpa":0,"skill":[0,0,0],"id":"20"}', 0, 'We are sorry, you are not meet the gender requirement, the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (21, 7, '{"gender":0,"gpa":0,"skill":[0,0,0],"id":"21"}', 0, 'We are sorry, you are not meet the gender requirement, the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (22, 7, '{"gender":0,"gpa":0,"skill":[0,0,0],"id":"22"}', 0, 'We are sorry, you are not meet the gender requirement, the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (23, 7, '{"gender":1,"gpa":0,"skill":[1,1,1],"id":"23"}', 80, 'We are sorry, you are not meet the GPA requirement.', 'I think you need to maximize your skill with your current GPA'), (24, 7, '{"gender":0,"gpa":0,"skill":[0,1,1],"id":"24"}', 40, 'We are sorry, you are not meet the gender requirement, the GPA requirement, and the php skill.', 'I think you need to maximize your skill with your current GPA'), (25, 7, '{"gender":0,"gpa":0,"skill":[0,0,0],"id":"25"}', 0, 'We are sorry, you are not meet the gender requirement, the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (26, 7, '{"gender":1,"gpa":0,"skill":[0,0,0],"id":"26"}', 20, 'We are sorry, you are not meet the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (27, 7, '{"gender":1,"gpa":0,"skill":[1,0,0],"id":"27"}', 40, 'We are sorry, you are not meet the GPA requirement, the html skill, and the css skill.', 'Your skill barely meet the requirement. Please study more than the others'), (28, 7, '{"gender":1,"gpa":0,"skill":[0,1,1],"id":"28"}', 60, 'We are sorry, you are not meet the GPA requirement, and the php skill.', 'I think you need to maximize your skill with your current GPA'), (29, 7, '{"gender":1,"gpa":0,"skill":[0,0,0],"id":"29"}', 20, 'We are sorry, you are not meet the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (30, 7, '{"gender":1,"gpa":0,"skill":[0,0,0],"id":"30"}', 20, 'We are sorry, you are not meet the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'), (31, 2, NULL, NULL, NULL, NULL), (31, 7, '{"gender":1,"gpa":0,"skill":[0,0,0],"id":"31"}', 20, 'We are sorry, you are not meet the GPA requirement, the php skill, the html skill, and the css skill.', 'Your skill does not meet the requirement. Please find other job with your current skill.'); -- -------------------------------------------------------- -- -- Table structure for table `requirements` -- CREATE TABLE `requirements` ( `id` int(11) NOT NULL, `vacancy_id` int(11) NOT NULL, `text` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `requirements` -- INSERT INTO `requirements` (`id`, `vacancy_id`, `text`) VALUES (1, 1, 'PHP'), (2, 1, 'Excel'), (3, 3, 'bisa mandi'), (4, 3, 'bisa belajar'), (5, 4, 'bisa mandi'), (6, 4, 'bisa belajar'), (15, 7, 'Hands on with code in either of GoLang, C, C++, Node.js, Ruby, Python. Multi-programming-lingual. The more the merrier.'), (16, 7, 'Prior experience with e-commerce or web application development (REST).'), (20, 7, 'Experience with HTML5, CSS, JQuery, Bootstrap etc.'); -- -------------------------------------------------------- -- -- Table structure for table `tasks` -- CREATE TABLE `tasks` ( `id` int(11) NOT NULL, `vacancy_id` int(11) NOT NULL, `criteria` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tasks` -- INSERT INTO `tasks` (`id`, `vacancy_id`, `criteria`) VALUES (1, 2, '{ \n "gender" : "male", \n "gpa" : "3.00",\n "bachelor" : "true",\n "skill" : ["PHP", "Excel"]\n}'), (4, 7, '{"gender":"male","gpa":"3.00","skill":["php","html","css"]}'); -- -------------------------------------------------------- -- -- Table structure for table `vacancies` -- CREATE TABLE `vacancies` ( `id` int(11) NOT NULL, `company_id` int(11) NOT NULL, `position_name` varchar(255) NOT NULL, `salary_start` int(11) NOT NULL, `salary_end` int(11) NOT NULL, `description` text NOT NULL, `status` int(11) DEFAULT '0' COMMENT 'ini buat menandakan, lowongan masih dibuka apa nggak. 0 masih dibuka, 1 sedang otw di proses oleh sistem, 2 closed' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `vacancies` -- INSERT INTO `vacancies` (`id`, `company_id`, `position_name`, `salary_start`, `salary_end`, `description`, `status`) VALUES (1, 1, 'Web Developer', 100000, 200000, 'looking for back end developer', 1), (2, 5, 'DB Admin', 1000, 5000, 'looking for DB Admin', 0), (3, 1, 'Mobile Developer', 1000, 5000, 'looking for React Native Codinger', 1), (4, 5, 'Teacher', 1000, 5000, 'Looking for English Teacher', 2), (5, 1, 'Writer', 1000, 5000, 'looking game script writer', 0), (7, 5, 'Software Engineer', 9000000, 12000000, 'looking for Software Engineer', 2), (9, 6, 'Software Engineer', 8000000, 10000000, 'Need Software Engineer', 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `companies` -- ALTER TABLE `companies` ADD PRIMARY KEY (`id`); -- -- Indexes for table `hunters` -- ALTER TABLE `hunters` ADD PRIMARY KEY (`id`); -- -- Indexes for table `hunter_vacancy` -- ALTER TABLE `hunter_vacancy` ADD PRIMARY KEY (`hunter_id`,`vacancy_id`), ADD KEY `hunter_id` (`hunter_id`), ADD KEY `vacancy_id` (`vacancy_id`); -- -- Indexes for table `requirements` -- ALTER TABLE `requirements` ADD PRIMARY KEY (`id`), ADD KEY `vacancy_id` (`vacancy_id`); -- -- Indexes for table `tasks` -- ALTER TABLE `tasks` ADD PRIMARY KEY (`id`), ADD KEY `vacancy_id` (`vacancy_id`); -- -- Indexes for table `vacancies` -- ALTER TABLE `vacancies` ADD PRIMARY KEY (`id`), ADD KEY `company_id` (`company_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `companies` -- ALTER TABLE `companies` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `hunters` -- ALTER TABLE `hunters` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32; -- -- AUTO_INCREMENT for table `requirements` -- ALTER TABLE `requirements` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; -- -- AUTO_INCREMENT for table `tasks` -- ALTER TABLE `tasks` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `vacancies` -- ALTER TABLE `vacancies` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- Constraints for dumped tables -- -- -- Constraints for table `hunter_vacancy` -- ALTER TABLE `hunter_vacancy` ADD CONSTRAINT `hunter_vacancy_ibfk_1` FOREIGN KEY (`vacancy_id`) REFERENCES `vacancies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `hunter_vacancy_ibfk_2` FOREIGN KEY (`hunter_id`) REFERENCES `hunters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `requirements` -- ALTER TABLE `requirements` ADD CONSTRAINT `requirements_ibfk_1` FOREIGN KEY (`vacancy_id`) REFERENCES `vacancies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `tasks` -- ALTER TABLE `tasks` ADD CONSTRAINT `tasks_ibfk_1` FOREIGN KEY (`vacancy_id`) REFERENCES `vacancies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `vacancies` -- ALTER TABLE `vacancies` ADD CONSTRAINT `vacancies_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; /*!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 */;
alter table ad_field add column iscentrallymaintained char(1) not null default 'N';
<reponame>smith750/kc<gh_stars>0 DELIMITER / CREATE TABLE IACUC_PROTOCOL_PROJECT_TYPE ( PROJECT_TYPE_CODE VARCHAR(3) NOT NULL, DESCRIPTION VARCHAR(200) NOT NULL, UPDATE_TIMESTAMP DATE NOT NULL, UPDATE_USER VARCHAR(60) NOT NULL, VER_NBR DECIMAL(8,0) DEFAULT 1 NOT NULL, OBJ_ID VARCHAR(36) NOT NULL) ENGINE InnoDB CHARACTER SET utf8 COLLATE utf8_bin / ALTER TABLE IACUC_PROTOCOL_PROJECT_TYPE ADD CONSTRAINT PK_IACUC_PROTOCOL_PROJECT_TYPE PRIMARY KEY (PROJECT_TYPE_CODE) / DELIMITER ;
-- Album insert into gw_collab_Album values (1, '2014-01-10', 'aá', 'aaaaa','aaaaa', 1, 1); insert into gw_collab_Album values (2, '2011-11-11', '1á', 'a11111aaaa','aa1111aaa', 2, 1); -- Album_Elements insert into gw_collab_Album_Elements values (1, 'photo', 1, null); insert into gw_collab_Album_Elements values (2, 'aaa', 2, null); insert into gw_collab_Album_Elements values (3, null, 3, null); -- Binomial insert into gw_collab_Binomial values (1, 50, null, null, 'Simétrica', null, null, 'Assimétrica', 5); insert into gw_collab_Binomial values (1, 50, null, null, 'Horizontal', null, null, 'Vertical', 5); -- Binomial_Evaluation insert into gw_collab_Binomial_Evaluation values (1, 'photo', 1, null, 50, 1, 1); insert into gw_collab_Binomial_Evaluation values (2, 'photo', 2, null, 20, 2, 2); -- Comment insert into gw_collab_Comment values (1, '2015-01-27', null, 1, null, 'foto muito boa', 1, 1); insert into gw_collab_Comment values (2, '2015-01-27', null, 2, null, 'foto muito boa', 1, 2); -- Counter insert into gw_collab_Counter values (5, '2015-01-27', null, null, null, 1, null, null, 10, 1); insert into gw_collab_Counter values (6, '2014-01-28', null, null, null, 2, null, null, 2, 1); -- CounterLog insert into CounterLog values (7, '2014-01-01', 1, 1); insert into CounterLog values (8, '2014-01-02', 2, 2); -- Counter_CounterLog insert into gw_collab_Counter_CounterLog values (1, 7); insert into gw_collab_Counter_CounterLog values (2, 8); -- External_Account insert into gw_collab_External_Account values (1, 'a', 1, 'a', 1, 1); insert into gw_collab_External_Account values (2, 'n', 2, 'n', 2, 2); -- Friendship insert into gw_collab_Friendship values (1, 1, 1); insert into gw_collab_Friendship values (2, 2, 2); -- Friends insert into gw_collab_Friends values (1, 2); insert into gw_collab_Friends values (2, 1); -- Friends_Requests insert into gw_collab_Friends_Requests values (1, 2); insert into gw_collab_Friends_Requests values (2, 1); -- Role insert into gw_collab_Role values (4, 'Administrador', 2); insert into gw_collab_Role values (5, 'Usuario', 2); insert into gw_collab_Role values (6, 'Visitante', 2); -- Tag insert into gw_collab_Tag values (27, 1, 'Tag', 19); insert into gw_collab_Tag values (28, 1, 'TagDOis', 19); -- Tag_Assignments insert into gw_collab_Tag_Assignments values (27, null, 1, null); insert into gw_collab_Tag_Assignments values (28, null, 1, null); -- Users_Roles insert into gw_collab_users_roles values (1, 4); insert into gw_collab_users_roles values (2, 5); -- Faq insert into Faq values (1, 'pergunta1', 'resposta1', 1); insert into Faq values (2, 'pergunta2', 'resposta2', 2);
<filename>testdatamass/store_store.sql use StoreModule; INSERT INTO `store_store` (`id`, `name`) VALUES (1, 'London'), (2, 'Moscow'), (3, 'New York'), (4, 'Rostov v Danu'), (5, 'Подвальчик'), (6, '<NAME>');
DROP TABLE IF EXISTS `hl_adlist`; CREATE TABLE `hl_adlist` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cid` int(11) NOT NULL, `title` varchar(50) NOT NULL, `img` varchar(100) DEFAULT NULL, `link` varchar(200) DEFAULT NULL, `desc` varchar(255) DEFAULT NULL, `siteid` tinyint(4) DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; insert into `hl_adlist` VALUES ( '1','2','宣传1','storage/cd/20191205/518545ad5d8f5f92d22f71a420d3c29e.jpg','','','1' ) ;
# --- Created by Ebean DDL # To stop Ebean DDL generation, remove this comment and start using Evolutions # --- !Ups create table item ( item_id varchar(255) not null, title varchar(255), cost double, description varchar(255), catagory varchar(255), address varchar(255), constraint pk_item primary key (item_id) ); create sequence id_gen; create table testimony ( id varchar(255) not null, title varchar(255), description varchar(255), constraint pk_testimony primary key (id) ); create sequence id; create table user ( email varchar(255) not null, name varchar(255), role varchar(255), password varchar(255), constraint pk_user primary key (email) ); # --- !Downs drop table if exists item; drop sequence if exists id_gen; drop table if exists testimony; drop sequence if exists id; drop table if exists user;
-- Copyright (c) 2016-2018 Timescale, Inc. All Rights Reserved. -- -- This file is licensed under the Apache License, see LICENSE-APACHE -- at the top level directory of the TimescaleDB distribution. CREATE OR REPLACE FUNCTION _timescaledb_internal.generate_uuid() RETURNS UUID AS '@MODULE_PATHNAME@', 'ts_uuid_generate' LANGUAGE C VOLATILE STRICT; -- Insert uuid and install_timestamp on database creation. Don't -- create exported_uuid because it gets exported and installed during -- pg_dump, which would cause a conflict. INSERT INTO _timescaledb_catalog.installation_metadata SELECT 'uuid', _timescaledb_internal.generate_uuid() ON CONFLICT DO NOTHING; INSERT INTO _timescaledb_catalog.installation_metadata SELECT 'install_timestamp', now() ON CONFLICT DO NOTHING;
<gh_stars>0 {{ config( materialized='view' ) }} SELECT order_id , product_id , quantity FROM {{ source('tutorial', 'order_items') }}
-- Procedure ma hoa luong moi khi them nhan vien vao bang NhanVien CREATE OR REPLACE PROCEDURE Them_NhanVien (maNV IN VARCHAR2,hoTen IN VARCHAR2,diaChi IN VARCHAR2,dienThoai IN VARCHAR2,email IN VARCHAR2,maPhong IN VARCHAR2,chiNhanh IN VARCHAR2,luong IN VARCHAR2) AS BEGIN DECLARE I_luong VARCHAR(2000) := luong; I_luong_raw RAW(2000); I_key_len NUMBER := 128/8; I_key RAW(2000); I_mod PLS_INTEGER := dbms_crypto.ENCRYPT_AES128 + dbms_crypto.CHAIN_CBC + dbms_crypto.PAD_PKCS5; BEGIN dbms_output.PUT_LINE ('Original :' || I_luong); I_key := dbms_crypto.RANDOMBYTES (I_key_len); I_luong_raw := dbms_crypto.ENCRYPT ( src => UTL_I18N.STRING_TO_RAW (I_luong,'AL32UTF8'), typ => I_mod, key => I_key ); INSERT INTO SYS.NHANVIEN VALUES(I_key,maNV, hoTen, diaChi, dienThoai, email, maPhong, chiNhanh, I_luong_raw); END; END; --Procedure giai ma thong tin luong cua moi nhan vien CREATE OR REPLACE PROCEDURE XemLuong_NhanVien AS user VARCHAR2(100); CURSOR TBL_NV IS SELECT maNV FROM SYS.NhanVien ; I_luong VARCHAR2(2000); I_decrypted_raw RAW(2000); I_mod PLS_INTEGER := dbms_crypto.ENCRYPT_AES256 + dbms_crypto.CHAIN_CBC + dbms_crypto.PAD_PKCS5; BEGIN user:= SYS_CONTEXT('userenv','SESSION_USER'); FOR ROW_NV in TBL_NV LOOP IF( ROW_NV.maNV = user )THEN I_decrypted_raw := dbms_crypto.DECRYPT ( src => SYS.NhanVien.luong, typ => I_mod, key => SYS.NhanVien.key); I_luong := UTL_I18N.RAW_TO_CHAR (I_decrypted_raw, 'AL32UTF8'); dbms_output.PUT_LINE('luong:' || I_luong); END IF; END LOOP; END; --Cap procedure cho cac role GRANT EXECUTE ON XemLuong_NhanVien TO rNhanVien, rTruongPhong, rTruongChiNhanh, rGiamDoc, rTruongDuAn;
-- SPDX-License-Identifier: Apache-2.0 -- Licensed to the Ed-Fi Alliance under one or more agreements. -- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. -- See the LICENSE and NOTICES files in the project root for more information. DO $$ DECLARE application_id INTEGER; claim_id INTEGER; claim_name VARCHAR(2048); parent_resource_claim_id INTEGER; existing_parent_resource_claim_id INTEGER; claim_set_id INTEGER; claim_set_name VARCHAR(255); authorization_strategy_id INTEGER; create_action_id INTEGER; read_action_id INTEGER; update_action_id INTEGER; delete_action_id INTEGER; claim_id_stack INTEGER ARRAY; BEGIN SELECT applicationid INTO application_id FROM dbo.applications WHERE ApplicationName = 'Ed-Fi ODS API'; SELECT actionid INTO create_action_id FROM dbo.actions WHERE ActionName = 'Create'; SELECT actionid INTO read_action_id FROM dbo.actions WHERE ActionName = 'Read'; SELECT actionid INTO update_action_id FROM dbo.actions WHERE ActionName = 'Update'; SELECT actionid INTO delete_action_id FROM dbo.actions WHERE ActionName = 'Delete'; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of root ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('tpdm', 'tpdm', 'http://ed-fi.org/ods/identity/claims/domains/tpdm', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Processing claimsets for http://ed-fi.org/ods/identity/claims/domains/tpdm ---------------------------------------------------------------------------------------------------------------------------- -- Claim set: 'Ed-Fi Sandbox' ---------------------------------------------------------------------------------------------------------------------------- claim_set_name := 'Ed-Fi Sandbox'; claim_set_id := NULL; SELECT ClaimSetId INTO claim_set_id FROM dbo.ClaimSets WHERE ClaimSetName = claim_set_name; IF claim_set_id IS NULL THEN RAISE NOTICE 'Creating new claim set: %', claim_set_name; INSERT INTO dbo.ClaimSets(ClaimSetName, Application_ApplicationId) VALUES (claim_set_name, application_id) RETURNING ClaimSetId INTO claim_set_id; END IF; RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; DELETE FROM dbo.ClaimSetResourceClaims WHERE ClaimSet_ClaimSetId = claim_set_id AND ResourceClaim_ResourceClaimId = claim_id; -- Claim set-specific Create authorization authorization_strategy_id := NULL; IF authorization_strategy_id IS NULL THEN RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; ELSE RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ', authorizationStrategyId = ' || authorization_strategy_id || ').'; END IF; INSERT INTO dbo.ClaimSetResourceClaims(ResourceClaim_ResourceClaimId, ClaimSet_ClaimSetId, Action_ActionId, AuthorizationStrategyOverride_AuthorizationStrategyId) VALUES (claim_id, claim_set_id, Create_action_id, authorization_strategy_id); -- Create -- Claim set-specific Read authorization authorization_strategy_id := NULL; IF authorization_strategy_id IS NULL THEN RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ').'; ELSE RAISE NOTICE USING MESSAGE = 'Creating ''Read'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Read_action_id || ', authorizationStrategyId = ' || authorization_strategy_id || ').'; END IF; INSERT INTO dbo.ClaimSetResourceClaims(ResourceClaim_ResourceClaimId, ClaimSet_ClaimSetId, Action_ActionId, AuthorizationStrategyOverride_AuthorizationStrategyId) VALUES (claim_id, claim_set_id, Read_action_id, authorization_strategy_id); -- Read -- Claim set-specific Update authorization authorization_strategy_id := NULL; IF authorization_strategy_id IS NULL THEN RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ').'; ELSE RAISE NOTICE USING MESSAGE = 'Creating ''Update'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Update_action_id || ', authorizationStrategyId = ' || authorization_strategy_id || ').'; END IF; INSERT INTO dbo.ClaimSetResourceClaims(ResourceClaim_ResourceClaimId, ClaimSet_ClaimSetId, Action_ActionId, AuthorizationStrategyOverride_AuthorizationStrategyId) VALUES (claim_id, claim_set_id, Update_action_id, authorization_strategy_id); -- Update -- Claim set-specific Delete authorization authorization_strategy_id := NULL; IF authorization_strategy_id IS NULL THEN RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ').'; ELSE RAISE NOTICE USING MESSAGE = 'Creating ''Delete'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Delete_action_id || ', authorizationStrategyId = ' || authorization_strategy_id || ').'; END IF; INSERT INTO dbo.ClaimSetResourceClaims(ResourceClaim_ResourceClaimId, ClaimSet_ClaimSetId, Action_ActionId, AuthorizationStrategyOverride_AuthorizationStrategyId) VALUES (claim_id, claim_set_id, Delete_action_id, authorization_strategy_id); -- Delete -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/performanceEvaluation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/performanceEvaluation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('performanceEvaluation', 'performanceEvaluation', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/performanceEvaluation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Setting default authorization metadata RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; DELETE FROM dbo.ResourceClaimAuthorizationMetadatas WHERE ResourceClaim_ResourceClaimId = claim_id; -- Default Create authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Create_action_id, authorization_strategy_id); -- Default Read authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Read_action_id, authorization_strategy_id); -- Default Update authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Update_action_id, authorization_strategy_id); -- Default Delete authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Delete_action_id, authorization_strategy_id); -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/performanceEvaluation ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('performanceEvaluation', 'performanceEvaluation', 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/evaluation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/evaluation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('evaluation', 'evaluation', 'http://ed-fi.org/ods/identity/claims/tpdm/evaluation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationObjective' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationObjective'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('evaluationObjective', 'evaluationObjective', 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationObjective', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationElement' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationElement'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('evaluationElement', 'evaluationElement', 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationElement', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/rubricDimension' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/rubricDimension'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('rubricDimension', 'rubricDimension', 'http://ed-fi.org/ods/identity/claims/tpdm/rubricDimension', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasure' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasure'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('quantitativeMeasure', 'quantitativeMeasure', 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasure', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationRating' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationRating'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('evaluationRating', 'evaluationRating', 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationRating', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationObjectiveRating' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationObjectiveRating'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('evaluationObjectiveRating', 'evaluationObjectiveRating', 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationObjectiveRating', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationElementRating' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationElementRating'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('evaluationElementRating', 'evaluationElementRating', 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationElementRating', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasureScore' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasureScore'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('quantitativeMeasureScore', 'quantitativeMeasureScore', 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasureScore', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluationRating' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluationRating'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('performanceEvaluationRating', 'performanceEvaluationRating', 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluationRating', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/goal' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/goal'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('goal', 'goal', 'http://ed-fi.org/ods/identity/claims/tpdm/goal', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Setting default authorization metadata RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; DELETE FROM dbo.ResourceClaimAuthorizationMetadatas WHERE ResourceClaim_ResourceClaimId = claim_id; -- Default Create authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Create_action_id, authorization_strategy_id); -- Default Read authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Read_action_id, authorization_strategy_id); -- Default Update authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Update_action_id, authorization_strategy_id); -- Default Delete authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Delete_action_id, authorization_strategy_id); -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/credentials' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/credentials'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('credentials', 'credentials', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/credentials', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Setting default authorization metadata RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; DELETE FROM dbo.ResourceClaimAuthorizationMetadatas WHERE ResourceClaim_ResourceClaimId = claim_id; -- Default Create authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Namespace Based'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Namespace Based'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Create_action_id, authorization_strategy_id); -- Default Read authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Namespace Based'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Namespace Based'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Read_action_id, authorization_strategy_id); -- Default Update authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Namespace Based'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Namespace Based'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Update_action_id, authorization_strategy_id); -- Default Delete authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Namespace Based'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Namespace Based'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Delete_action_id, authorization_strategy_id); -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/credentials ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/certification' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/certification'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('certification', 'certification', 'http://ed-fi.org/ods/identity/claims/tpdm/certification', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExam' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExam'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('certificationExam', 'certificationExam', 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExam', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExamResult' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExamResult'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('certificationExamResult', 'certificationExamResult', 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExamResult', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/credentialEvent' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/credentialEvent'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('credentialEvent', 'credentialEvent', 'http://ed-fi.org/ods/identity/claims/tpdm/credentialEvent', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Setting default authorization metadata RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; DELETE FROM dbo.ResourceClaimAuthorizationMetadatas WHERE ResourceClaim_ResourceClaimId = claim_id; -- Default Create authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Create_action_id, authorization_strategy_id); -- Default Read authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Read_action_id, authorization_strategy_id); -- Default Update authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Update_action_id, authorization_strategy_id); -- Default Delete authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Delete_action_id, authorization_strategy_id); -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/professionalDevelopment' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/professionalDevelopment'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('professionalDevelopment', 'professionalDevelopment', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/professionalDevelopment', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Setting default authorization metadata RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; DELETE FROM dbo.ResourceClaimAuthorizationMetadatas WHERE ResourceClaim_ResourceClaimId = claim_id; -- Default Create authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Create_action_id, authorization_strategy_id); -- Default Read authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Read_action_id, authorization_strategy_id); -- Default Update authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Update_action_id, authorization_strategy_id); -- Default Delete authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Delete_action_id, authorization_strategy_id); -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/professionalDevelopment ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/professionalDevelopmentEvent' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/professionalDevelopmentEvent'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('professionalDevelopmentEvent', 'professionalDevelopmentEvent', 'http://ed-fi.org/ods/identity/claims/tpdm/professionalDevelopmentEvent', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/professionalDevelopmentEventAttendance' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/professionalDevelopmentEventAttendance'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('professionalDevelopmentEventAttendance', 'professionalDevelopmentEventAttendance', 'http://ed-fi.org/ods/identity/claims/tpdm/professionalDevelopmentEventAttendance', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/recruiting' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/recruiting'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('recruiting', 'recruiting', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/recruiting', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Setting default authorization metadata RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; DELETE FROM dbo.ResourceClaimAuthorizationMetadatas WHERE ResourceClaim_ResourceClaimId = claim_id; -- Default Create authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Create_action_id, authorization_strategy_id); -- Default Read authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Read_action_id, authorization_strategy_id); -- Default Update authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Update_action_id, authorization_strategy_id); -- Default Delete authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Delete_action_id, authorization_strategy_id); -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/recruiting ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/application' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/application'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('application', 'application', 'http://ed-fi.org/ods/identity/claims/tpdm/application', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/applicationEvent' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/applicationEvent'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('applicationEvent', 'applicationEvent', 'http://ed-fi.org/ods/identity/claims/tpdm/applicationEvent', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionEvent' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionEvent'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('openStaffPositionEvent', 'openStaffPositionEvent', 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionEvent', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/recruitmentEvent' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/recruitmentEvent'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('recruitmentEvent', 'recruitmentEvent', 'http://ed-fi.org/ods/identity/claims/tpdm/recruitmentEvent', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Setting default authorization metadata RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; DELETE FROM dbo.ResourceClaimAuthorizationMetadatas WHERE ResourceClaim_ResourceClaimId = claim_id; -- Default Create authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Create_action_id, authorization_strategy_id); -- Default Read authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Read_action_id, authorization_strategy_id); -- Default Update authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Update_action_id, authorization_strategy_id); -- Default Delete authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Delete_action_id, authorization_strategy_id); -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/noFurtherAuthorizationRequiredData' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/noFurtherAuthorizationRequiredData'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('noFurtherAuthorizationRequiredData', 'noFurtherAuthorizationRequiredData', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/noFurtherAuthorizationRequiredData', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Setting default authorization metadata RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; DELETE FROM dbo.ResourceClaimAuthorizationMetadatas WHERE ResourceClaim_ResourceClaimId = claim_id; -- Default Create authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Create_action_id, authorization_strategy_id); -- Default Read authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Read_action_id, authorization_strategy_id); -- Default Update authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Update_action_id, authorization_strategy_id); -- Default Delete authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Delete_action_id, authorization_strategy_id); -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/noFurtherAuthorizationRequiredData ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/personRoleAssociations' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/personRoleAssociations'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('personRoleAssociations', 'personRoleAssociations', 'http://ed-fi.org/ods/identity/claims/domains/personRoleAssociations', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/personRoleAssociations ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/applicantProspectAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/applicantProspectAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('applicantProspectAssociation', 'applicantProspectAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/applicantProspectAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/completerAsStaffAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/completerAsStaffAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('completerAsStaffAssociation', 'completerAsStaffAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/completerAsStaffAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/staffApplicantAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/staffApplicantAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('staffApplicantAssociation', 'staffApplicantAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/staffApplicantAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/staffProspectAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/staffProspectAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('staffProspectAssociation', 'staffProspectAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/staffProspectAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStaffAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStaffAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidateStaffAssociation', 'teacherCandidateStaffAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStaffAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/staffPreparation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/staffPreparation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('staffPreparation', 'staffPreparation', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/staffPreparation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/staffPreparation ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasure' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasure'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('staffStudentGrowthMeasure', 'staffStudentGrowthMeasure', 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasure', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasureCourseAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasureCourseAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('staffStudentGrowthMeasureCourseAssociation', 'staffStudentGrowthMeasureCourseAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasureCourseAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasureEducationOrganizationAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasureEducationOrganizationAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('staffStudentGrowthMeasureEducationOrganizationAssociation', 'staffStudentGrowthMeasureEducationOrganizationAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasureEducationOrganizationAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasureSectionAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasureSectionAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('staffStudentGrowthMeasureSectionAssociation', 'staffStudentGrowthMeasureSectionAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/staffStudentGrowthMeasureSectionAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/staffTeacherPreparationProviderAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/staffTeacherPreparationProviderAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('staffTeacherPreparationProviderAssociation', 'staffTeacherPreparationProviderAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/staffTeacherPreparationProviderAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/staffTeacherPreparationProviderProgramAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/staffTeacherPreparationProviderProgramAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('staffTeacherPreparationProviderProgramAssociation', 'staffTeacherPreparationProviderProgramAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/staffTeacherPreparationProviderProgramAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/teacherCandidatePreparation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/teacherCandidatePreparation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidatePreparation', 'teacherCandidatePreparation', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/teacherCandidatePreparation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/teacherCandidatePreparation ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateAcademicRecord' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateAcademicRecord'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidateAcademicRecord', 'teacherCandidateAcademicRecord', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateAcademicRecord', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateCourseTranscript' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateCourseTranscript'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidateCourseTranscript', 'teacherCandidateCourseTranscript', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateCourseTranscript', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasure' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasure'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidateStudentGrowthMeasure', 'teacherCandidateStudentGrowthMeasure', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasure', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasureCourseAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasureCourseAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidateStudentGrowthMeasureCourseAssociation', 'teacherCandidateStudentGrowthMeasureCourseAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasureCourseAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasureEducationOrganizationAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasureEducationOrganizationAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidateStudentGrowthMeasureEducationOrganizationAssociation', 'teacherCandidateStudentGrowthMeasureEducationOrganizationAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasureEducationOrganizationAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasureSectionAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasureSectionAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidateStudentGrowthMeasureSectionAssociation', 'teacherCandidateStudentGrowthMeasureSectionAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateStudentGrowthMeasureSectionAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateTeacherPreparationProviderAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateTeacherPreparationProviderAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidateTeacherPreparationProviderAssociation', 'teacherCandidateTeacherPreparationProviderAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateTeacherPreparationProviderAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateTeacherPreparationProviderProgramAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateTeacherPreparationProviderProgramAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidateTeacherPreparationProviderProgramAssociation', 'teacherCandidateTeacherPreparationProviderProgramAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateTeacherPreparationProviderProgramAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/students' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/students'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('students', 'students', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/students', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/students ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/fieldworkExperience' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/fieldworkExperience'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('fieldworkExperience', 'fieldworkExperience', 'http://ed-fi.org/ods/identity/claims/tpdm/fieldworkExperience', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/fieldworkExperienceSectionAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/fieldworkExperienceSectionAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('fieldworkExperienceSectionAssociation', 'fieldworkExperienceSectionAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/fieldworkExperienceSectionAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/employment' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/employment'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('employment', 'employment', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/employment', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/employment ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/employmentEvent' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/employmentEvent'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('employmentEvent', 'employmentEvent', 'http://ed-fi.org/ods/identity/claims/tpdm/employmentEvent', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/employmentSeparationEvent' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/employmentSeparationEvent'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('employmentSeparationEvent', 'employmentSeparationEvent', 'http://ed-fi.org/ods/identity/claims/tpdm/employmentSeparationEvent', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/anonymizedStudentAcademics' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/anonymizedStudentAcademics'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('anonymizedStudentAcademics', 'anonymizedStudentAcademics', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/anonymizedStudentAcademics', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/anonymizedStudentAcademics ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudent' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudent'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('anonymizedStudent', 'anonymizedStudent', 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudent', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAcademicRecord' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAcademicRecord'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('anonymizedStudentAcademicRecord', 'anonymizedStudentAcademicRecord', 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAcademicRecord', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAssessment' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAssessment'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('anonymizedStudentAssessment', 'anonymizedStudentAssessment', 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAssessment', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAssessmentCourseAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAssessmentCourseAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('anonymizedStudentAssessmentCourseAssociation', 'anonymizedStudentAssessmentCourseAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAssessmentCourseAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAssessmentSectionAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAssessmentSectionAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('anonymizedStudentAssessmentSectionAssociation', 'anonymizedStudentAssessmentSectionAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentAssessmentSectionAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentCourseAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentCourseAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('anonymizedStudentCourseAssociation', 'anonymizedStudentCourseAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentCourseAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentCourseTranscript' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentCourseTranscript'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('anonymizedStudentCourseTranscript', 'anonymizedStudentCourseTranscript', 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentCourseTranscript', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentEducationOrganizationAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentEducationOrganizationAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('anonymizedStudentEducationOrganizationAssociation', 'anonymizedStudentEducationOrganizationAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentEducationOrganizationAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentSectionAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentSectionAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('anonymizedStudentSectionAssociation', 'anonymizedStudentSectionAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/anonymizedStudentSectionAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherPreparationProviderProgram' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherPreparationProviderProgram'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherPreparationProviderProgram', 'teacherPreparationProviderProgram', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherPreparationProviderProgram', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Setting default authorization metadata RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; DELETE FROM dbo.ResourceClaimAuthorizationMetadatas WHERE ResourceClaim_ResourceClaimId = claim_id; -- Default Create authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Create_action_id, authorization_strategy_id); -- Default Read authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Read_action_id, authorization_strategy_id); -- Default Update authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Update_action_id, authorization_strategy_id); -- Default Delete authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'Relationships with Education Organizations only'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''Relationships with Education Organizations only'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Delete_action_id, authorization_strategy_id); -- Processing claimsets for http://ed-fi.org/ods/identity/claims/tpdm/teacherPreparationProviderProgram ---------------------------------------------------------------------------------------------------------------------------- -- Claim set: 'Bootstrap Descriptors and EdOrgs' ---------------------------------------------------------------------------------------------------------------------------- claim_set_name := 'Bootstrap Descriptors and EdOrgs'; claim_set_id := NULL; SELECT ClaimSetId INTO claim_set_id FROM dbo.ClaimSets WHERE ClaimSetName = claim_set_name; IF claim_set_id IS NULL THEN RAISE NOTICE 'Creating new claim set: %', claim_set_name; INSERT INTO dbo.ClaimSets(ClaimSetName, Application_ApplicationId) VALUES (claim_set_name, application_id) RETURNING ClaimSetId INTO claim_set_id; END IF; RAISE NOTICE USING MESSAGE = 'Deleting existing actions for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ') on resource claim ''' || claim_name || '''.'; DELETE FROM dbo.ClaimSetResourceClaims WHERE ClaimSet_ClaimSetId = claim_set_id AND ResourceClaim_ResourceClaimId = claim_id; -- Claim set-specific Create authorization authorization_strategy_id := NULL; IF authorization_strategy_id IS NULL THEN RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ').'; ELSE RAISE NOTICE USING MESSAGE = 'Creating ''Create'' action for claim set ''' || claim_set_name || ''' (claimSetId=' || claim_set_id || ', actionId = ' || Create_action_id || ', authorizationStrategyId = ' || authorization_strategy_id || ').'; END IF; INSERT INTO dbo.ClaimSetResourceClaims(ResourceClaim_ResourceClaimId, ClaimSet_ClaimSetId, Action_ActionId, AuthorizationStrategyOverride_AuthorizationStrategyId) VALUES (claim_id, claim_set_id, Create_action_id, authorization_strategy_id); -- Create -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/systemDescriptors' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/systemDescriptors'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('systemDescriptors', 'systemDescriptors', 'http://ed-fi.org/ods/identity/claims/domains/systemDescriptors', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/systemDescriptors ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/descriptors' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/descriptors'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('descriptors', 'descriptors', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/descriptors', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/descriptors ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/accreditationStatusDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/accreditationStatusDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('accreditationStatusDescriptor', 'accreditationStatusDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/accreditationStatusDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/aidTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/aidTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('aidTypeDescriptor', 'aidTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/aidTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/applicationEventResultDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/applicationEventResultDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('applicationEventResultDescriptor', 'applicationEventResultDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/applicationEventResultDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/applicationEventTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/applicationEventTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('applicationEventTypeDescriptor', 'applicationEventTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/applicationEventTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/applicationSourceDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/applicationSourceDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('applicationSourceDescriptor', 'applicationSourceDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/applicationSourceDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/applicationStatusDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/applicationStatusDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('applicationStatusDescriptor', 'applicationStatusDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/applicationStatusDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/backgroundCheckStatusDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/backgroundCheckStatusDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('backgroundCheckStatusDescriptor', 'backgroundCheckStatusDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/backgroundCheckStatusDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/backgroundCheckTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/backgroundCheckTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('backgroundCheckTypeDescriptor', 'backgroundCheckTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/backgroundCheckTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExamStatusDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExamStatusDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('certificationExamStatusDescriptor', 'certificationExamStatusDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExamStatusDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExamTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExamTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('certificationExamTypeDescriptor', 'certificationExamTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/certificationExamTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/certificationFieldDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/certificationFieldDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('certificationFieldDescriptor', 'certificationFieldDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/certificationFieldDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/certificationLevelDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/certificationLevelDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('certificationLevelDescriptor', 'certificationLevelDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/certificationLevelDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/certificationRouteDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/certificationRouteDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('certificationRouteDescriptor', 'certificationRouteDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/certificationRouteDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/certificationStandardDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/certificationStandardDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('certificationStandardDescriptor', 'certificationStandardDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/certificationStandardDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/coteachingStyleObservedDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/coteachingStyleObservedDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('coteachingStyleObservedDescriptor', 'coteachingStyleObservedDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/coteachingStyleObservedDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/credentialEventTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/credentialEventTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('credentialEventTypeDescriptor', 'credentialEventTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/credentialEventTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/credentialStatusDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/credentialStatusDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('credentialStatusDescriptor', 'credentialStatusDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/credentialStatusDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/degreeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/degreeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('degreeDescriptor', 'degreeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/degreeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/educatorRoleDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/educatorRoleDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('educatorRoleDescriptor', 'educatorRoleDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/educatorRoleDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/employmentEventTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/employmentEventTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('employmentEventTypeDescriptor', 'employmentEventTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/employmentEventTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/employmentSeparationReasonDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/employmentSeparationReasonDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('employmentSeparationReasonDescriptor', 'employmentSeparationReasonDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/employmentSeparationReasonDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/employmentSeparationTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/employmentSeparationTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('employmentSeparationTypeDescriptor', 'employmentSeparationTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/employmentSeparationTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/englishLanguageExamDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/englishLanguageExamDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('englishLanguageExamDescriptor', 'englishLanguageExamDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/englishLanguageExamDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationElementRatingLevelDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationElementRatingLevelDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('evaluationElementRatingLevelDescriptor', 'evaluationElementRatingLevelDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationElementRatingLevelDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationPeriodDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationPeriodDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('evaluationPeriodDescriptor', 'evaluationPeriodDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationPeriodDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationRatingLevelDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationRatingLevelDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('evaluationRatingLevelDescriptor', 'evaluationRatingLevelDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationRatingLevelDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('evaluationTypeDescriptor', 'evaluationTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/evaluationTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/federalLocaleCodeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/federalLocaleCodeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('federalLocaleCodeDescriptor', 'federalLocaleCodeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/federalLocaleCodeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/fieldworkTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/fieldworkTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('fieldworkTypeDescriptor', 'fieldworkTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/fieldworkTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/fundingSourceDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/fundingSourceDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('fundingSourceDescriptor', 'fundingSourceDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/fundingSourceDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/genderDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/genderDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('genderDescriptor', 'genderDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/genderDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/goalTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/goalTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('goalTypeDescriptor', 'goalTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/goalTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/hireStatusDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/hireStatusDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('hireStatusDescriptor', 'hireStatusDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/hireStatusDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/hiringSourceDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/hiringSourceDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('hiringSourceDescriptor', 'hiringSourceDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/hiringSourceDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/instructionalSettingDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/instructionalSettingDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('instructionalSettingDescriptor', 'instructionalSettingDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/instructionalSettingDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/internalExternalHireDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/internalExternalHireDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('internalExternalHireDescriptor', 'internalExternalHireDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/internalExternalHireDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/levelOfDegreeAwardedDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/levelOfDegreeAwardedDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('levelOfDegreeAwardedDescriptor', 'levelOfDegreeAwardedDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/levelOfDegreeAwardedDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/objectiveRatingLevelDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/objectiveRatingLevelDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('objectiveRatingLevelDescriptor', 'objectiveRatingLevelDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/objectiveRatingLevelDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionEventStatusDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionEventStatusDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('openStaffPositionEventStatusDescriptor', 'openStaffPositionEventStatusDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionEventStatusDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionEventTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionEventTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('openStaffPositionEventTypeDescriptor', 'openStaffPositionEventTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionEventTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionReasonDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionReasonDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('openStaffPositionReasonDescriptor', 'openStaffPositionReasonDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/openStaffPositionReasonDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluationRatingLevelDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluationRatingLevelDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('performanceEvaluationRatingLevelDescriptor', 'performanceEvaluationRatingLevelDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluationRatingLevelDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluationTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluationTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('performanceEvaluationTypeDescriptor', 'performanceEvaluationTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/performanceEvaluationTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/previousCareerDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/previousCareerDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('previousCareerDescriptor', 'previousCareerDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/previousCareerDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/professionalDevelopmentOfferedByDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/professionalDevelopmentOfferedByDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('professionalDevelopmentOfferedByDescriptor', 'professionalDevelopmentOfferedByDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/professionalDevelopmentOfferedByDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/programGatewayDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/programGatewayDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('programGatewayDescriptor', 'programGatewayDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/programGatewayDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/prospectTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/prospectTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('prospectTypeDescriptor', 'prospectTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/prospectTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasureDatatypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasureDatatypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('quantitativeMeasureDatatypeDescriptor', 'quantitativeMeasureDatatypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasureDatatypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasureTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasureTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('quantitativeMeasureTypeDescriptor', 'quantitativeMeasureTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/quantitativeMeasureTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/recruitmentEventTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/recruitmentEventTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('recruitmentEventTypeDescriptor', 'recruitmentEventTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/recruitmentEventTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/rubricRatingLevelDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/rubricRatingLevelDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('rubricRatingLevelDescriptor', 'rubricRatingLevelDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/rubricRatingLevelDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/salaryTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/salaryTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('salaryTypeDescriptor', 'salaryTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/salaryTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/schoolStatusDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/schoolStatusDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('schoolStatusDescriptor', 'schoolStatusDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/schoolStatusDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/studentGrowthTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/studentGrowthTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('studentGrowthTypeDescriptor', 'studentGrowthTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/studentGrowthTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateCharacteristicDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateCharacteristicDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidateCharacteristicDescriptor', 'teacherCandidateCharacteristicDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidateCharacteristicDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherPreparationProgramTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherPreparationProgramTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherPreparationProgramTypeDescriptor', 'teacherPreparationProgramTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherPreparationProgramTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/tPPDegreeTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/tPPDegreeTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('tPPDegreeTypeDescriptor', 'tPPDegreeTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/tPPDegreeTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/tPPProgramPathwayDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/tPPProgramPathwayDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('tPPProgramPathwayDescriptor', 'tPPProgramPathwayDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/tPPProgramPathwayDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/valueTypeDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/valueTypeDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('valueTypeDescriptor', 'valueTypeDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/valueTypeDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/withdrawReasonDescriptor' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/withdrawReasonDescriptor'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('withdrawReasonDescriptor', 'withdrawReasonDescriptor', 'http://ed-fi.org/ods/identity/claims/tpdm/withdrawReasonDescriptor', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/educationOrganizations' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/educationOrganizations'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('educationOrganizations', 'educationOrganizations', 'http://ed-fi.org/ods/identity/claims/domains/educationOrganizations', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/educationOrganizations ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherPreparationProvider' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherPreparationProvider'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherPreparationProvider', 'teacherPreparationProvider', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherPreparationProvider', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/university' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/university'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('university', 'university', 'http://ed-fi.org/ods/identity/claims/tpdm/university', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/people' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/people'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('people', 'people', 'http://ed-fi.org/ods/identity/claims/domains/people', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/people ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/tpdm/people' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/tpdm/people'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('people', 'people', 'http://ed-fi.org/ods/identity/claims/domains/tpdm/people', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Setting default authorization metadata RAISE NOTICE USING MESSAGE = 'Deleting default action authorizations for resource claim ''' || claim_name || ''' (claimId=' || claim_id || ').'; DELETE FROM dbo.ResourceClaimAuthorizationMetadatas WHERE ResourceClaim_ResourceClaimId = claim_id; -- Default Create authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Create_action_id, authorization_strategy_id); -- Default Read authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Read_action_id, authorization_strategy_id); -- Default Update authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Update_action_id, authorization_strategy_id); -- Default Delete authorization authorization_strategy_id := NULL; SELECT a.AuthorizationStrategyId INTO authorization_strategy_id FROM dbo.AuthorizationStrategies a WHERE a.DisplayName = 'No Further Authorization Required'; IF authorization_strategy_id IS NULL THEN RAISE EXCEPTION USING MESSAGE = 'AuthorizationStrategy does not exist: ''No Further Authorization Required'''; END IF; INSERT INTO dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId, Action_ActionId, AuthorizationStrategy_AuthorizationStrategyId) VALUES (claim_id, Delete_action_id, authorization_strategy_id); -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/tpdm/people ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidate' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidate'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('teacherCandidate', 'teacherCandidate', 'http://ed-fi.org/ods/identity/claims/tpdm/teacherCandidate', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/applicant' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/applicant'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('applicant', 'applicant', 'http://ed-fi.org/ods/identity/claims/tpdm/applicant', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/prospect' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/prospect'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('prospect', 'prospect', 'http://ed-fi.org/ods/identity/claims/tpdm/prospect', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/domains/surveyDomain' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/domains/surveyDomain'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('surveyDomain', 'surveyDomain', 'http://ed-fi.org/ods/identity/claims/domains/surveyDomain', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of http://ed-fi.org/ods/identity/claims/domains/surveyDomain ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'https://ed-fi.org/ods/identity/claims/domains/tpdm/survey' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'https://ed-fi.org/ods/identity/claims/domains/tpdm/survey'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('survey', 'survey', 'https://ed-fi.org/ods/identity/claims/domains/tpdm/survey', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Push claimId to the stack claim_id_stack := array_append(claim_id_stack, claim_id); -- Processing children of https://ed-fi.org/ods/identity/claims/domains/tpdm/survey ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/surveySectionAggregateResponse' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/surveySectionAggregateResponse'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('surveySectionAggregateResponse', 'surveySectionAggregateResponse', 'http://ed-fi.org/ods/identity/claims/tpdm/surveySectionAggregateResponse', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/surveyResponseTeacherCandidateTargetAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/surveyResponseTeacherCandidateTargetAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('surveyResponseTeacherCandidateTargetAssociation', 'surveyResponseTeacherCandidateTargetAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/surveyResponseTeacherCandidateTargetAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; ---------------------------------------------------------------------------------------------------------------------------- -- Resource Claim: 'http://ed-fi.org/ods/identity/claims/tpdm/surveySectionResponseTeacherCandidateTargetAssociation' ---------------------------------------------------------------------------------------------------------------------------- claim_name := 'http://ed-fi.org/ods/identity/claims/tpdm/surveySectionResponseTeacherCandidateTargetAssociation'; claim_id := NULL; SELECT ResourceClaimId, ParentResourceClaimId INTO claim_id, existing_parent_resource_claim_id FROM dbo.ResourceClaims WHERE ClaimName = claim_name; parent_resource_claim_id := claim_id_stack[array_upper(claim_id_stack, 1)]; IF claim_id IS NULL THEN RAISE NOTICE 'Creating new claim: %', claim_name; INSERT INTO dbo.ResourceClaims(DisplayName, ResourceName, ClaimName, ParentResourceClaimId, Application_ApplicationId) VALUES ('surveySectionResponseTeacherCandidateTargetAssociation', 'surveySectionResponseTeacherCandidateTargetAssociation', 'http://ed-fi.org/ods/identity/claims/tpdm/surveySectionResponseTeacherCandidateTargetAssociation', parent_resource_claim_id, application_id) RETURNING ResourceClaimId INTO claim_id; ELSE IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (ResourceClaimId=' || parent_resource_claim_id || ')'; UPDATE dbo.ResourceClaims SET ParentResourceClaimId = parent_resource_claim_id WHERE ResourceClaimId = claim_id; END IF; END IF; -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); -- Pop the stack claim_id_stack := (select claim_id_stack[1:array_upper(claim_id_stack, 1) - 1]); END $$;
-- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION forecastsolver" to load this file. \quit -- Install all the required data types -- Registers the solver and 1 method. WITH -- Registers the solver and its parameters. solver AS (INSERT INTO sl_solver(name, version, author_name, author_url, description) values ('forecastingsolver', 1.1, '', '', 'A solver for energy demand time series forecasting by <NAME>') returning sid), -- Registers the BASIC method. It has no parameters. method1 AS (INSERT INTO sl_solver_method(sid, name, name_full, func_name, prob_name, description) SELECT sid, 'default', 'The ERGV based technique for energy demand time series forecasting', 'forecasting_solve_default', 'Time series forecasting problem', 'Solves the forecasting problem utilizing the LP solver' FROM solver RETURNING mid) -- Perform the actual insert SELECT count(*) FROM solver, method1; -- Set the default method UPDATE sl_solver s SET default_method_id = mid FROM sl_solver_method m WHERE (s.sid = m.sid) AND (s.name = 'forecastingsolver') AND (m.name='default'); -- Install the solver method CREATE OR REPLACE FUNCTION forecasting_solve_default(arg sl_solver_arg) RETURNS setof record AS $$ DECLARE foundAttTime boolean; -- Was the time attribute found? foundAttLoad boolean; -- Was the electricity load attribute found? foundRelTemp boolean; -- Was the temperature relations supplied in SUBJECTTO? i int; -- Index t sl_attribute_desc; v_o sl_viewsql_out; v_d sl_viewsql_dst; BEGIN -- Check the type on unknown-variable columns IF (SELECT count(*) FROM sl_get_attributes(arg)) <> 3 /* One for ordering (ID) column */ THEN RAISE EXCEPTION 'The input relation must have two columns "time" and "load"!'; END IF; -- Check the type on unknown-variable columns foundAttTime = COALESCE((SELECT count(*)=1 FROM sl_get_attributes(arg) WHERE att_kind = 'unknown'::sl_attribute_kind AND att_name = 'time'), false); foundAttLoad = COALESCE((SELECT count(*)=1 FROM sl_get_attributes(arg) WHERE att_kind = 'unknown'::sl_attribute_kind AND att_name = 'load'), false); IF NOT (foundAttLoad AND foundAttTime) THEN RAISE EXCEPTION 'The columns "time" and "load" were not found in the unknown attribute list!'; END IF; -- Check contextual data, e.g., temperature time-series foundRelTemp:= False; FOR i IN SELECT generate_subscripts((arg.problem).ctr_sql, 1) -- Run for every constrint query LOOP -- Prepares the destination view over the constraint "i" IF (SELECT count(*) FROM sl_get_attributes_from_sql(sl_build_dst_ctr(arg, sl_build_out(arg), i)) as tt WHERE tt.att_name='time' OR tt.att_name='temp') = 2 THEN PERFORM sl_create_view(sl_build_dst_ctr(arg, sl_build_out(arg), i), 'temperature_view'); foundRelTemp = true; END IF; END LOOP; -- Create a dummy temperature view, if not specified IF (NOT foundRelTemp) THEN CREATE TEMP VIEW temperature_view AS SELECT (NULL::timestamp) AS time, NULL::float8 as temp; END IF; -- Create a view on the input relation PERFORM sl_create_view(sl_build_out(arg),'raw_data_view'); -- Create a predictor variable view CREATE TEMP VIEW raw_data_predictors AS WITH extendedTS AS (SELECT (d.time::date) as date, EXTRACT(hour FROM d.time) as hour, d.load, t.temp FROM (SELECT time::timestamp, load FROM raw_data_view UNION SELECT (SELECT max(time)::date + 1 FROM raw_data_view)::timestamp + hour * (INTERVAL '1 hour'), NULL FROM generate_series(0,23) as hour ) AS d LEFT OUTER JOIN temperature_view t ON (d.time=t.time)), maxTemps AS (SELECT date, max(temp) as maxtemp FROM extendedTS GROUP BY date), loads8am AS (SELECT date, load as load8am FROM extendedTS WHERE hour = 8) SELECT (date::timestamp::date) as date, hour, load::float8, COALESCE(temp, 20) AS temp, COALESCE(temp, 20)^2 AS temp2, COALESCE((SELECT maxtemp FROM maxTemps WHERE date=d.date-1), 20) as tempymax, COALESCE((SELECT load8am FROM loads8am WHERE date=d.date-1), 0) as load8am, EXTRACT(YEAR FROM date) AS year, (EXTRACT(MONTH FROM date)=1)::int AS jan, (EXTRACT(MONTH FROM date)=2)::int AS feb, (EXTRACT(MONTH FROM date)=3)::int AS mar, (EXTRACT(MONTH FROM date)=4)::int AS apr, (EXTRACT(MONTH FROM date)=5)::int AS may, (EXTRACT(MONTH FROM date)=6)::int AS jun, (EXTRACT(MONTH FROM date)=7)::int AS jul, (EXTRACT(MONTH FROM date)=8)::int AS aug, (EXTRACT(MONTH FROM date)=9)::int AS sep, (EXTRACT(MONTH FROM date)=10)::int AS oct, (EXTRACT(MONTH FROM date)=11)::int AS nov, (EXTRACT(DOW FROM date)=1)::int AS mon, (EXTRACT(DOW FROM date)=2)::int AS tue, (EXTRACT(DOW FROM date)=3)::int AS wed, (EXTRACT(DOW FROM date)=4)::int AS thu, (EXTRACT(DOW FROM date)=5)::int AS fri, (EXTRACT(DOW FROM date)=6)::int AS sat FROM extendedTS AS d; --COPY (SELECT * FROM raw_data_predictors) TO '/home/laurynas/Projects/pg_out1' (DELIMITER '|'); --COPY (SELECT * FROM raw_loadtemps) TO '/home/laurynas/Projects/pg_out2' (DELIMITER '|'); -- We're now estimating model parameters with the LP solver CREATE TEMP TABLE forecast_params AS -- Find model parameters SOLVESELECT peps, pyear, pjan, pfeb, pmar, papr, pmay, pjun, pjul, paug, psep, poct, pnov, pmon, ptue, pwed, pthu, pfri, psat, ptemp, ptemp2, ptempymax, pload8am IN (SELECT phour, 0.0 AS peps, 0.0 AS pyear, 0.0 AS pjan, 0.0 AS pfeb, 0.0 AS pmar, 0.0 AS papr, 0.0 AS pmay, 0.0 AS pjun, 0.0 AS pjul, 0.0 AS paug, 0.0 AS psep, 0.0 AS poct, 0.0 AS pnov, 0.0 AS pmon, 0.0 AS ptue, 0.0 AS pwed, 0.0 AS pthu, 0.0 AS pfri, 0.0 AS psat, 0.0 AS ptemp, 0.0 AS ptemp2,0.0 AS ptempymax, 0.0 AS pload8am FROM generate_series(0,23) phour) AS p WITH xp, xn IN (SELECT *, 0.0 AS xp, 0.0 AS xn FROM raw_data_predictors WHERE load IS NOT NULL) AS u MINIMIZE (SELECT sum(xp + xn) FROM u) /* The LP trick to be able to minimize sum of absolute values */ SUBJECTTO (SELECT xp>=0, xn>=0 FROM u), (SELECT u.xp - u.xn = /* Data value - Model value */ u.load - ( p.peps + p.pyear*u.year + p.pjan*u.jan::int4 + p.pfeb*u.feb::int4 + p.pmar*u.mar::int4 + p.papr*u.apr::int4 + p.pmay*u.may::int4 + p.pjun*u.jun::int4 + p.pjul*u.jul::int4 + p.paug*u.aug::int4 + p.psep*u.sep::int4 + p.poct*u.oct::int4 + p.pnov*u.nov::int4 + p.pmon*u.mon::int4 + p.ptue*u.tue::int4 + p.pwed*u.wed::int4 + p.pthu*u.thu::int4 + p.pfri*u.fri::int4 + p.psat*u.sat::int4 + p.ptemp*u.temp + p.ptemp2*u.temp2 + p.ptempymax*u.tempymax + p.pload8am*u.load8am) FROM p INNER JOIN u ON p.phour = u.hour) USING solverlp.auto(use_nulls := 0 /* Increases performance, as PostgreSQL does not have to de-index NULL arrays*/); -- We're now applying the model parameters and create the output view CREATE TEMP VIEW forecast_result AS SELECT time, load FROM raw_data_view UNION SELECT (d.date::timestamp + (d.hour * (INTERVAL '1 hour'))) as time, ( /* Model value */ p.peps + p.pyear*d.year + p.pjan*d.jan::int4 + p.pfeb*d.feb::int4 + p.pmar*d.mar::int4 + p.papr*d.apr::int4 + p.pmay*d.may::int4 + p.pjun*d.jun::int4 + p.pjul*d.jul::int4 + p.paug*d.aug::int4 + p.psep*d.sep::int4 + p.poct*d.oct::int4 + p.pnov*d.nov::int4 + p.pmon*d.mon::int4 + p.ptue*d.tue::int4 + p.pwed*d.wed::int4 + p.pthu*d.thu::int4 + p.pfri*d.fri::int4 + p.psat*d.sat::int4 + p.ptemp*d.temp + p.ptemp2*d.temp2 + p.ptempymax*d.tempymax + p.pload8am*d.load8am) as load FROM raw_data_predictors AS d INNER JOIN forecast_params AS p ON d.hour = p.phour WHERE d.load IS NULL; -- Output the forecasting result. As only two columns (time and load) are supported, no additional join is needed RETURN QUERY EXECUTE sl_return(arg, ROW('SELECT time, load FROM forecast_result')::sl_viewsql_out); -- Clean-up DROP VIEW forecast_result; DROP TABLE forecast_params; DROP VIEW raw_data_predictors; DROP VIEW temperature_view; PERFORM sl_drop_view('raw_data_view'); END $$ LANGUAGE plpgsql VOLATILE STRICT; /* Testing the solver */ /* SELECT time, load FROM ( SOLVESELECT * IN (SELECT time, load FROM hist_load) AS s USING forecastingsolver) AS s ORDER BY time DESC SELECT time, load FROM ( SOLVESELECT * IN (SELECT ('2012-01-01'::timestamp + hour * (INTERVAL '1 hour')) AS time, 123+hour/10 AS load FROM generate_series(0, 99) as hour) AS t SUBJECTTO(SELECT ('2012-01-01'::timestamp + hour * (INTERVAL '1 hour')) AS time, (hour/20) AS temp FROM generate_series(0, 150) as hour) USING forecastingsolver) AS s ORDER BY time DESC SELECT time, load FROM ( SOLVESELECT load IN (SELECT (date::timestamp + hour * (INTERVAL '1 hour')) as time, load FROM loaddata) AS s SUBJECTTO (SELECT (date::timestamp + hour * (INTERVAL '1 hour')) as time, temp FROM loadtemps) USING forecastingsolver) AS s ORDER BY time DESC; RAISE NOTICE 'Fitting MSE(%)', (SELECT sum((d.load - p.peps + p.pyear*d.year + p.pjan*d.jan::int4 + p.pfeb*d.feb::int4 + p.pmar*d.mar::int4 + p.papr*d.apr::int4 + p.pmay*d.may::int4 + p.pjun*d.jun::int4 + p.pjul*d.jul::int4 + p.paug*d.aug::int4 + p.psep*d.sep::int4 + p.poct*d.oct::int4 + p.pnov*d.nov::int4 + p.pmon*d.mon::int4 + p.ptue*d.tue::int4 + p.pwed*d.wed::int4 + p.pthu*d.thu::int4 + p.pfri*d.fri::int4 + p.psat*d.sat::int4 + p.ptemp*d.temp + p.ptemp2*d.temp2 + p.ptempymax*d.tempymax + p.pload8am*d.load8am))^2) FROM raw_data_predictors AS d INNER JOIN forecast_params AS p ON d.hour = p.phour WHERE (d.load IS NOT NULL)); */
drop index if exists fki_readings_fk1; CREATE INDEX fki_readings_fk1 ON fledge.readings USING btree (asset_code);
HDF5 "2_vds.h5" { GROUP "/" { DATASET "vds_dset" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 6, 8, 14 ) / ( H5S_UNLIMITED, 8, 14 ) } DATA { (0,0,0): 10, 10, 10, 10, 10, 10, 10, 40, 40, 40, 40, 40, 40, 40, (0,1,0): 10, 10, 10, 10, 10, 10, 10, 40, 40, 40, 40, 40, 40, 40, (0,2,0): 20, 20, 20, 20, 20, 20, 20, 40, 40, 40, 40, 40, 40, 40, (0,3,0): 20, 20, 20, 20, 20, 20, 20, 40, 40, 40, 40, 40, 40, 40, (0,4,0): 20, 20, 20, 20, 20, 20, 20, 40, 40, 40, 40, 40, 40, 40, (0,5,0): 20, 20, 20, 20, 20, 20, 20, 50, 50, 50, 50, 50, 50, 50, (0,6,0): 30, 30, 30, 30, 30, 30, 30, 50, 50, 50, 50, 50, 50, 50, (0,7,0): 30, 30, 30, 30, 30, 30, 30, 50, 50, 50, 50, 50, 50, 50, (1,0,0): 11, 11, 11, 11, 11, 11, 11, 41, 41, 41, 41, 41, 41, 41, (1,1,0): 11, 11, 11, 11, 11, 11, 11, 41, 41, 41, 41, 41, 41, 41, (1,2,0): 21, 21, 21, 21, 21, 21, 21, 41, 41, 41, 41, 41, 41, 41, (1,3,0): 21, 21, 21, 21, 21, 21, 21, 41, 41, 41, 41, 41, 41, 41, (1,4,0): 21, 21, 21, 21, 21, 21, 21, 41, 41, 41, 41, 41, 41, 41, (1,5,0): 21, 21, 21, 21, 21, 21, 21, 51, 51, 51, 51, 51, 51, 51, (1,6,0): 31, 31, 31, 31, 31, 31, 31, 51, 51, 51, 51, 51, 51, 51, (1,7,0): 31, 31, 31, 31, 31, 31, 31, 51, 51, 51, 51, 51, 51, 51, (2,0,0): 12, 12, 12, 12, 12, 12, 12, 42, 42, 42, 42, 42, 42, 42, (2,1,0): 12, 12, 12, 12, 12, 12, 12, 42, 42, 42, 42, 42, 42, 42, (2,2,0): 22, 22, 22, 22, 22, 22, 22, 42, 42, 42, 42, 42, 42, 42, (2,3,0): 22, 22, 22, 22, 22, 22, 22, 42, 42, 42, 42, 42, 42, 42, (2,4,0): 22, 22, 22, 22, 22, 22, 22, 42, 42, 42, 42, 42, 42, 42, (2,5,0): 22, 22, 22, 22, 22, 22, 22, 52, 52, 52, 52, 52, 52, 52, (2,6,0): 32, 32, 32, 32, 32, 32, 32, 52, 52, 52, 52, 52, 52, 52, (2,7,0): 32, 32, 32, 32, 32, 32, 32, 52, 52, 52, 52, 52, 52, 52, (3,0,0): 13, 13, 13, 13, 13, 13, 13, 43, 43, 43, 43, 43, 43, 43, (3,1,0): 13, 13, 13, 13, 13, 13, 13, 43, 43, 43, 43, 43, 43, 43, (3,2,0): 23, 23, 23, 23, 23, 23, 23, 43, 43, 43, 43, 43, 43, 43, (3,3,0): 23, 23, 23, 23, 23, 23, 23, 43, 43, 43, 43, 43, 43, 43, (3,4,0): 23, 23, 23, 23, 23, 23, 23, 43, 43, 43, 43, 43, 43, 43, (3,5,0): 23, 23, 23, 23, 23, 23, 23, 53, 53, 53, 53, 53, 53, 53, (3,6,0): 33, 33, 33, 33, 33, 33, 33, 53, 53, 53, 53, 53, 53, 53, (3,7,0): 33, 33, 33, 33, 33, 33, 33, 53, 53, 53, 53, 53, 53, 53, (4,0,0): 14, 14, 14, 14, 14, 14, 14, 44, 44, 44, 44, 44, 44, 44, (4,1,0): 14, 14, 14, 14, 14, 14, 14, 44, 44, 44, 44, 44, 44, 44, (4,2,0): 24, 24, 24, 24, 24, 24, 24, 44, 44, 44, 44, 44, 44, 44, (4,3,0): 24, 24, 24, 24, 24, 24, 24, 44, 44, 44, 44, 44, 44, 44, (4,4,0): 24, 24, 24, 24, 24, 24, 24, 44, 44, 44, 44, 44, 44, 44, (4,5,0): 24, 24, 24, 24, 24, 24, 24, 54, 54, 54, 54, 54, 54, 54, (4,6,0): 34, 34, 34, 34, 34, 34, 34, 54, 54, 54, 54, 54, 54, 54, (4,7,0): 34, 34, 34, 34, 34, 34, 34, 54, 54, 54, 54, 54, 54, 54, (5,0,0): 15, 15, 15, 15, 15, 15, 15, 45, 45, 45, 45, 45, 45, 45, (5,1,0): 15, 15, 15, 15, 15, 15, 15, 45, 45, 45, 45, 45, 45, 45, (5,2,0): 25, 25, 25, 25, 25, 25, 25, 45, 45, 45, 45, 45, 45, 45, (5,3,0): 25, 25, 25, 25, 25, 25, 25, 45, 45, 45, 45, 45, 45, 45, (5,4,0): 25, 25, 25, 25, 25, 25, 25, 45, 45, 45, 45, 45, 45, 45, (5,5,0): 25, 25, 25, 25, 25, 25, 25, 55, 55, 55, 55, 55, 55, 55, (5,6,0): 35, 35, 35, 35, 35, 35, 35, 55, 55, 55, 55, 55, 55, 55, (5,7,0): 35, 35, 35, 35, 35, 35, 35, 55, 55, 55, 55, 55, 55, 55 } } } }
-- MySQL dump 10.18 Distrib 10.3.27-MariaDB, for debian-linux-gnueabihf (armv8l) -- -- Host: localhost Database: keexybox -- ------------------------------------------------------ -- Server version 10.3.27-MariaDB-0+deb10u1 /*!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 utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `config` -- DROP TABLE IF EXISTS `config`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `config` ( `param` varchar(255) NOT NULL, `value` mediumtext CHARACTER SET utf8mb4 DEFAULT NULL, `type` varchar(25) NOT NULL, `description` varchar(300) DEFAULT NULL, PRIMARY KEY (`param`), UNIQUE KEY `variable` (`param`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `config` -- LOCK TABLES `config` WRITE; /*!40000 ALTER TABLE `config` DISABLE KEYS */; INSERT INTO `config` VALUES ('apache_admin_https_port','8003','tcpip_port','Keexybox admin HTTPS port'),('apache_admin_port','8001','tcpip_port','HTTP port to keexybox admin'),('apache_denied_access_https_nolog_port','4431','tcpip_port','HTTPS port pointing to apache config with logs disabled'),('apache_denied_access_https_port','4430','tcpip_port','HTTPS port pointing to apache config with logs enabled'),('apache_denied_access_http_nolog_port','8081','tcpip_port','HTTP port pointing to apache config with logs disabled'),('apache_denied_access_http_port','8080','tcpip_port','HTTP port pointing to apache config with logs enabled'),('apache_envvars_conf_file','/etc/apache2/envvars','config_file','Apache2 envvars configuration file'),('apache_init','/etc/init.d/apache2','exec_file','Script to start/stop Apache'),('apache_log_dir','/var/log/apache2/','dir_path',''),('apache_ports_conf_file','/etc/apache2/ports.conf','config_file','apache2 ports.conf'),('apache_redirect_port','8002','tcpip_port','HTTP port for captive portal redirection'),('apache_vhosts_conf_file','/etc/apache2/sites-available/000-default.conf','config_file','Défault apache2 vhosts configuration file'),('arp_scan_oui_file','/opt/keexybox/keexyapp/src/Shell/scripts/ieee-oui.txt','config_file','Ethernet vendor OUI file for arp-scan'),('arp_scan_refresh_delay','600','setting','not used'),('bind9_init','/opt/keexybox/keexyapp/src/Shell/scripts/init_bind','exec_file','Script to start/stop Bind'),('bind_root_dir','/opt/keexybox/bind/','dir_path',''),('bind_use_redirectors','0','setting','Tell if bind have to use host_dns1 and host_dns2 as redirectors '),('bin_arp','/usr/sbin/arp','exec_file','Tool used to scan devices on the LAN'),('bin_arpscan','/usr/sbin/arp-scan','exec_file','Tool used to scan devices on the LAN'),('bin_cut','/usr/bin/cut','exec_file','bash util'),('bin_date','/bin/date','exec_file','You should know what it is ;)'),('bin_echo','/bin/echo','exec_file','bash util'),('bin_get-oui','/usr/bin/get-oui','exec_file_unused','command to update oui-file for arpscan'),('bin_grep','/bin/grep','exec_file','bash util'),('bin_halt','/sbin/halt','exec_file','Used to poweroff keexybox'),('bin_hwclock','/sbin/hwclock','exec_file','Tool to set clock on hardware device'),('bin_iptables','/sbin/iptables','exec_file','Iptables command to load website routing and ipfilters'),('bin_iptables_save','/sbin/iptables-save','exec_file','Command to save Iptables config'),('bin_mysql','/usr/bin/mysql','exec_file',''),('bin_nmap','/usr/bin/nmap','exec_file_unused','Tool to scan ports'),('bin_openssl','/usr/bin/openssl','exec_file','Command to generate certificate'),('bin_ping','/bin/ping','exec_file',''),('bin_python','/usr/bin/python','exec_file','Used to run python script like Blacklist or log import'),('bin_reboot','/sbin/reboot','exec_file','Used to reboot keexybox'),('bin_sudo','/usr/bin/sudo','exec_file','Used by keexybox user to run command as root'),('bin_sysctl','/sbin/sysctl','exec_file','Used to enable ipv4 forwarding'),('bin_tee','/usr/bin/tee','exec_file','Allow to send output of a job to file'),('connection_default_time','1209600','setting','Default connection duration (minutes)'),('connection_max_time','10080','setting','Max connection duration can be set by user (minutes)'),('cportal_brand_logo_url','','setting','Brand logo url to display on captive portal.'),('cportal_brand_name','','setting','Brand name to display on captive portal.'),('cportal_check_tor_url','https://check.torproject.org','setting','URL to check if a user use Tor'),('cportal_default_profile_id','1','setting','Profile to use for user registration'),('cportal_default_user_id','1','setting','User to use for fast login'),('cportal_homepage_button_name','Browse the Internet','setting','Home page button name to the Internet'),('cportal_homepage_button_url','https://duckduckgo.com/','setting','Home page button URL to the Internet'),('cportal_ip_info_url','http://ifconfig.co/','setting','URL to check Internet IP address and Finger print'),('cportal_record_mac','1','setting','Record Mac address of the device when users connects to the Internet.'),('cportal_record_useragent','1','setting','Record UserAgent information when users connects to the Internet.'),('cportal_register_allowed','0','setting','Bahavior of the Captive Portal - 0=Private (admin need to create accounts for users), 1=Registration (The user can create his account himself), 2=Free (Free access by accepting terms and conditions), 3=None (Captive portal is not needed to access the Internet)'),('cportal_register_code','REGCODE','setting','Code to allow user to register himself on Captive Portal'),('cportal_register_expiration','31','setting','Number of days until account expires when register'),('cportal_terms','<p>\r\n</p><h3>\r\nInternet Access Terms and Conditions<br></h3>\r\n<div>\r\n<div>\r\n<div>\r\n<p><small><b>Terms and Conditions</b></small></p><p><small>By\r\n using our internet service, you hereby expressly acknowledge and agree \r\nthat there are significant security, privacy and confidentiality risks \r\ninherent in accessing or transmitting information through the internet, \r\nwhether the connection is facilitated through wired or wireless \r\ntechnology. Security issues include, without limitation, interception of\r\n transmissions, loss of data, and the introduction or viruses and other \r\nprograms that can corrupt or damage your computer.</small></p><p><small>Accordingly,\r\n you agree that the owner and/or provider of this network is NOT liable \r\nfor any interception or transmissions, computer worms or viruses, loss \r\nof data, file corruption, hacking or damage to your computer or other \r\ndevices that result from the transmission or download of information or \r\nmaterials through the internet service provided.</small></p><p><small>Use\r\n of the wireless network is subject to the general restrictions outlined\r\n below. If abnormal, illegal, or unauthorized behavior is detected, \r\nincluding heavy consumption of bandwidth, the network provider reserves \r\nthe right to permanently disconnect the offending device from the \r\nwireless network.</small></p><p><small><b>Examples of Illegal Uses</b></small></p><small>The following are representative examples only and do not comprise a comprehensive list of illegal uses:</small><ol><li><small>Spamming\r\n and invasion of privacy - Sending of unsolicited bulk and/or commercial\r\n messages over the Internet using the Service or using the Service for \r\nactivities that invade another\'s privacy.</small></li><li><small>Intellectual\r\n property right violations - Engaging in any activity that infringes or \r\nmisappropriates the intellectual property rights of others, including \r\npatents, copyrights, trademarks, service marks, trade secrets, or any \r\nother proprietary right of any third party.</small></li><li><small>Accessing\r\n illegally or without authorization computers, accounts, equipment or \r\nnetworks belonging to another party, or attempting to \r\npenetrate/circumvent security measures of another system. This includes \r\nany activity that may be used as a precursor to an attempted system \r\npenetration, including, but not limited to, port scans, stealth scans, \r\nor other information gathering activity.</small></li><li><small>The transfer of technology, software, or other materials in violation of applicable export laws and regulations.</small></li><li><small>Export Control Violations</small></li><li><small>Using\r\n the Service in violation of applicable law and regulation, including, \r\nbut not limited to, advertising, transmitting, or otherwise making \r\navailable ponzi schemes, pyramid schemes, fraudulently charging credit \r\ncards, pirating software, or making fraudulent offers to sell or buy \r\nproducts, items, or services.</small></li><li><small>Uttering threats;</small></li><li><small>Distribution of pornographic materials to minors;</small></li><li><small>and Child pornography.</small></li></ol><p><small><b>Examples of Unacceptable Uses</b></small></p><p><small>The following are representative examples only and do not comprise a comprehensive list of unacceptable uses:</small></p><ol><li><small>High bandwidth operations, such as large file transfers and media sharing with peer-to-peer programs (i.e.torrents)</small></li><li><small>Obscene or indecent speech or materials</small></li><li><small>Defamatory or abusive language</small></li><li><small>Using\r\n the Service to transmit, post, upload, or otherwise making available \r\ndefamatory, harassing, abusive, or threatening material or language that\r\n encourages bodily harm, destruction of property or harasses another.</small></li><li><small>Forging or misrepresenting message headers, whether in whole or in part, to mask the originator of the message.</small></li><li><small>Facilitating a Violation of these Terms of Use</small></li><li><small>Hacking</small></li><li><small>Distribution of Internet viruses, Trojan horses, or other destructive activities</small></li><li><small>Distributing\r\n information regarding the creation of and sending Internet viruses, \r\nworms, Trojan horses, pinging, flooding, mail-bombing, or denial of \r\nservice attacks. Also, activities that disrupt the use of or interfere \r\nwith the ability of others to effectively use the node or any connected \r\nnetwork, system, service, or equipment.</small></li><li><small>Advertising,\r\n transmitting, or otherwise making available any software product, \r\nproduct, or service that is designed to violate these Terms of Use, \r\nwhich includes the facilitation of the means to spam, initiation of \r\npinging, flooding, mail-bombing, denial of service attacks, and piracy \r\nof software.</small></li><li><small>The sale, transfer, or \r\nrental of the Service to customers, clients or other third parties, \r\neither directly or as part of a service or product created for resale.</small></li><li><small>Seeking information on passwords or data belonging to another user.</small></li><li><small>Making unauthorized copies of proprietary software, or offering unauthorized copies of proprietary software to others.</small></li><li><small>Intercepting or examining the content of messages, files or communications in transit on a data network.</small></li></ol></div><div><small>(source: <a target=\"_blank\" rel=\"nofollow\" href=\"https://sites.google.com/site/wifitermsgeneric/\">https://sites.google.com/site/wifitermsgeneric/</a>)<br></small><p></p>\r\n\r\n</div></div></div><p></p>','setting','Text of Terms and conditions of Internet Access to display to users.'),('cportal_test_domains','connectivitycheck.gstatic.com,clients1.google.com,clients3.google.com,connect.rom.miui.com,captive.apple.com,airport.us,thinkdifferent.us,msftconnecttest.com,www.msftconnecttest.com','setting','Tested domains by clients to detect presence of a captive portal.'),('dhcp_conffile','/opt/keexybox/dhcpd/etc/dhcpd.conf','config_file',''),('dhcp_enabled','0','setting','Enable/Disable DHCP. set 1 no enable.'),('dhcp_enabled_input','0','setting','Enable/Disable DHCP for input network. set 1 to enable.'),('dhcp_enabled_output','0','setting','Enable/Disable DHCP for output network. set 1 to enable.'),('dhcp_end_ip','192.168.1.200','ipv4','First IP delivered by DHCP'),('dhcp_end_ip_input','192.168.2.201','ipv4','Last IP delivered by DHCP for input network'),('dhcp_end_ip_output','192.168.1.201','ipv4','Last IP delivered by DHCP for output network'),('dhcp_external','0','setting','Use DHCP for ouput network only.'),('dhcp_init','/opt/keexybox/keexyapp/src/Shell/scripts/init_dhcpd','exec_file','Script to start/stop DHCPd'),('dhcp_interfaces_conffile','/opt/keexybox/dhcpd/etc/interfaces.conf','config_file','Listening interfaces configuration file for DHCPd.'),('dhcp_reservations_conffile','/opt/keexybox/dhcpd/etc/dhcpd-reservations.conf','config_file','Reserved IP for DHCP configuration file'),('dhcp_start_ip','192.168.1.150','ipv4','Last IP delivered by DHCP'),('dhcp_start_ip_input','192.168.2.151','ipv4','First IP delivered by DHCP for input network'),('dhcp_start_ip_output','192.168.1.151','ipv4','First IP delivered by DHCP for output network'),('dns_expiration_delay','604800','setting','Delay that keexybox DNS should be renew. This cache is used for website routing.'),('hostapd_ap_isolate','0','setting','Isolation between connected clients (1=yes 0=no)'),('hostapd_auth_algs','1','setting','Enable Authentication for Access Point'),('hostapd_bridge','br0','setting','Used Bridge interface name for Access Point'),('hostapd_bridge_ports','eth0','setting','Wired bridging interface'),('hostapd_channel','8','setting','Frequency channel for Access Point'),('hostapd_conf_file','/opt/keexybox/hostapd/etc/hostapd.conf','config_file','Hostapd configuration file'),('hostapd_country_code','FR','setting','Country Code of Access Point'),('hostapd_enabled','0','setting','Enable Wifi Access Point (1=yes 0=no)'),('hostapd_host_interface_input_bak','eth0:0','setting','Used input interface before enabling hostapd'),('hostapd_host_interface_output_bak','eth0','setting','Used output interface before enabling hostapd'),('hostapd_hw_mode','g','setting','Wifi mode for Access Point (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g)'),('hostapd_ignore_broadcast_ssid','0','setting','Broadcast SSID Access Point (0=yes 1=No)'),('hostapd_init','/opt/keexybox/keexyapp/src/Shell/scripts/init_hostapd','exec_file','Script to start/stop hostapd'),('hostapd_interface','wlan0','setting','Used Wifi interface for Access Point'),('hostapd_macaddr_acl','0','setting','macaddr_acl'),('hostapd_rsn_pairwise','CCMP','setting','Accepted cipher suites for Access Point'),('hostapd_ssid','KeexyBox','setting','SSID of Access Point'),('hostapd_wmm_enabled','1','setting','wmm_enabled'),('hostapd_wpa','2','setting','WPA setting for Access Point'),('hostapd_wpa_key_mgmt','WPA-PSK','setting','Accepted key management algorithms for Access Point'),('hostapd_wpa_pairwise','TKIP','setting','Accepted cipher suites for Access Point'),('hostapd_wpa_passphrase','<PASSWORD>','setting','WPA passphrase of Access Point'),('hostname_conffile','/etc/hostname','config_file','File that contains hostname'),('host_dns1','8.8.8.8','ipv4','Keexybox primary DNS'),('host_dns2','','ipv4','Keexybox secondary DNS'),('host_gateway','192.168.1.1','ipv4','IP address of internet router'),('host_interface','eth0','setting','Keexybox network interface name'),('host_interface_input','eth0:0','setting','Host internal interface name'),('host_interface_output','eth0','setting','Host external interface name'),('host_ip','192.168.1.251','ipv4','Keexybox address'),('host_ip_input','192.168.2.254','ipv4','Host ip address for internal network'),('host_ip_output','192.168.1.254','ipv4','Host ip address for external network'),('host_name','kxbv2','setting','Keexybox device hostname'),('host_netmask','255.255.255.0','ipv4','Keexybox netmask'),('host_netmask_input','255.255.255.0','ipv4','Host netmask for internal network'),('host_netmask_output','255.255.255.0','ipv4','Host netmask for external network'),('host_ntp1','0.debian.pool.ntp.org','setting','Keexybox NTP server'),('host_ntp2','1.debian.pool.ntp.org','setting','Keexybox NTP server'),('host_timezone','Etc/GMT','setting','Keexybox Timezone'),('keexyboxlogs','/opt/keexybox/logs/','dir_path',''),('keexybox_root_dir','/opt/keexybox','dir_path','Root directory of Keexybox'),('locale','en_US','setting','Default locale'),('logrotate_conf_file','/etc/logrotate.d/keexybox','config_file','Keexybox logrotate configuration file'),('log_db_retention','31','setting','Log retention in database (days)'),('log_import_schedule_time','02:00','setting','Time to import logs to database (HH:MM)'),('log_retention','150','setting','log files retention (days)'),('named_port','5300','tcpip_port','DNS port pointing to bind9 configuration with logs enabled'),('named_port_nolog','5302','tcpip_port','DNS port pointing to bind9 configuration with logs disabled'),('named_port_portal','5305','tcpip_port','bind port for fake DNS root to redirect all domains to Keexybox IP for captive portal.'),('named_port_tor','5301','tcpip_port','DNS port pointing to bind9 configuration with logs enabled'),('named_port_tor_nolog','5303','tcpip_port','DNS port pointing to bind9/ttdnsd configuration with logs disabled'),('network_conffile','/etc/network/interfaces','config_file',''),('network_init','/etc/init.d/networking','exec_file','Script to start/stop network'),('nic_path','/sys/class/net/','dir_path','Path of network interfaces'),('ntp_conffile','/etc/ntp.conf','config_file',''),('ntp_init','/etc/init.d/ntp','exec_file','Script to start/stop NTP'),('privoxy_confdir','/opt/keexybox/privoxy/etc','dir_path_unused','Path to privoxy config directory'),('privoxy_conffile','/opt/keexybox/privoxy/etc/config','config_file_unused',''),('privoxy_port','8118','tcpip_port_unused','Privoxy port'),('redsocks_conffile','/opt/keexybox/redsocks/etc/redsocks.conf','config_file_unused',''),('redsocks_local_port','12345','tcpip_port_unused','Port that Redsocks listen on.'),('redsocks_proxy_ip','127.0.0.1','ipv4_unused','IP used by redsocks to redirect traffic to privoxy'),('redsocks_proxy_port','8118','tcpip_port_unused','Port redsocks redirect traffic to privoxy. Should be the same as privoxy port.'),('redsocks_type','http-connect','setting_unused','redsocks type of redirect'),('rndc_port','9530','tcpip_port','Management DNS port pointing to bind9 configuration with logs enabled'),('rndc_port_nolog','9532','tcpip_port','Management DNS port pointing to bind9 configuration with logs disabled'),('rndc_port_portal','9535','tcpip_port','rndc port to manage fake DNS root.'),('rndc_port_tor','9531','tcpip_port','Management DNS port pointing to bind9/ttdnsd configuration with logs enabled'),('rndc_port_tor_nolog','9533','tcpip_port','Management DNS port pointing to bind9/ttdnsd configuration with logs disabled'),('run_wizard','1','setting','Enable wizard to setup Keexybox'),('scripts_dir','/opt/keexybox/keexyapp/src/Shell/scripts/','dir_path','Keexybox script directory'),('ssl_crtfile','/opt/keexybox/ssl/keexybox.crt','config_file','Certificate file'),('ssl_csr_c','FR','setting','Certificate Country Code'),('ssl_csr_cn','keexybox.keexybox','setting','Certificate Common Name'),('ssl_csr_file','/opt/keexybox/ssl/keexybox.csr','config_file','Certificate Signing Request file'),('ssl_csr_l','Somewhere','setting','Certificate City'),('ssl_csr_o','Keexybox','setting','Certificate Organization'),('ssl_csr_ou','Home','setting','Certificate Organization Unit'),('ssl_csr_st','Some-State','setting','Certificate State'),('ssl_keyfile','/opt/keexybox/ssl/keexybox.key','config_file','Certificate Key file'),('ssl_keysize','2048','setting','Certificate Keysize'),('ssl_validity','3650','setting','Certificate Validity (days)'),('sudoers_conf_file','/etc/sudoers','config_file',''),('sudoers_keexybox_conf_file','/etc/sudoers.d/keexybox','config_file',''),('sudo_init','/etc/init.d/sudo','exec_file','Script to start/stop Sudo'),('tmp_dir','/opt/keexybox/tmp','dir_path','Temp directory used for KeexyBox updates'),('tor_conffile','/opt/keexybox/tor/etc/tor/torrc','config_file',''),('tor_control_password','16:<PASSWORD>','setting_unused','unused'),('tor_control_port','9051','tcpip_port_unused','unused'),('tor_dns_port','9053','tcpip_port','TOR DNSport'),('tor_exitnodes_countries','','setting','Force Tor Exit Nodes Countries.'),('tor_host','127.0.0.1','ipv4','IP address Tor is listen on'),('tor_init','/opt/keexybox/keexyapp/src/Shell/scripts/init_tor','exec_file','Script to start/stop Tor'),('tor_port','9050','tcpip_port','Port Tor is listen on'),('tor_trans_port','9040','tcpip_port','Tor transparent port'),('ttdnsd_defaults_conffile','/etc/default/ttdnsd','config_file_unused',''),('ttdnsd_dns1','8.8.8.8','ipv4_unused','DNS used by Tor exit node to resolv fqdn'),('ttdnsd_dns2',' 8.8.4.4','ipv4_unused','DNS used by Tor exit node to resolv fqdn'),('ttdnsd_dns_conffile','/etc/ttdnsd.conf','config_file_unused',''),('ttdnsd_host','127.0.0.1','ipv4_unused','IP address Ttdnsd is listen on'),('ttdnsd_init','/etc/init.d/ttdnsd','exec_file_unused','Script to start/stop Ttdnsd'),('ttdnsd_port','5304','tcpip_port_unused','Port Ttdnsd is listen on'),('ttdnsd_tsocks_conffile','/var/lib/ttdnsd/tsocks.conf','config_file_unused',''),('update_check_url','https://update.keexybox.org/check-update/arm/','setting','URL used to check KeexyBox Updates'),('version','21.04.2','setting','Keexybox version'),('wpa_config_file','/etc/wpa_supplicant/wpa_supplicant.conf','config_file','Wi-Fi Protected Access config file'); /*!40000 ALTER TABLE `config` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!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 */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2021-05-03 6:44:18
--- returns: one || none --- SELECT * FROM recoveries WHERE email = ${email} AND created_at > now() - interval '3 hours'
<reponame>mauriliofelipe/data-manipulation create database imdb character set utf8 collate utf8_general_ci; use imdb; create table if not exists films ( id int not null auto_increment, title varchar(255) not null, synopsis text not null, year year not null, maturity varchar(2) not null default 'L', rating double not null default 0.0, director varchar(100) not null, gender varchar(50) not null, registered timestamp not null default current_timestamp, primary key (id) ); insert into films values (1, 'Bastardos Inglórios', 'Durante a Segunda Guerra Mundial, na França, um grupo de judeus americanos conhecidos como Bastardos espalha o terror entre o terceiro Reich. Ao mesmo tempo, Shosanna, uma judia que fugiu dos nazistas, planeja vingança quando um evento em seu cinema reunirá os líderes do partido.', 2009, '18', 8.3, '<NAME>', 'Guerra', default), (2, 'Clube de Compras Dallas', '<NAME>, um eletricista heterossexual de Dallas, foi diagnosticado com AIDS em 1986, durante uma das épocas mais obscuras da doença. Embora os médicos tenham lhe dado apenas alguns meses de vida, Woodroof se recusou a aceitar o prognóstico e, procurando tratamentos alternativos, ele passa a contrabandear drogas ilegais do México.', 2013, '16', 8.0, '<NAME>', 'Drama', default), (3, 'Capitão Phillips', 'Em 2009, piratas somalis invadem o navio cargueiro MV Maersk Alabama, dos Estados Unidos, e mantêm o capitão Richard Phillips e sua tripulação como reféns.', 2013, '14', 7.8, '<NAME>', 'Drama', default), (4, 'O Lobo de Wall Street', '<NAME> é um ambicioso corretor da bolsa de valores que cria um verdadeiro império, enriquecendo de forma rápida, porém ilegal. Ele e seus amigos mergulham em um mundo de excessos, mas seus métodos ilícitos despertam a atenção da polícia.', 2013, '18', 8.2, '<NAME>', 'Biografia', default);
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Jun 03, 2021 at 06:20 AM -- Server version: 5.7.24 -- PHP Version: 7.3.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; 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 utf8mb4 */; -- -- Database: `qlsp` -- -- -------------------------------------------------------- -- -- Table structure for table `chuyenmuc` -- CREATE TABLE `chuyenmuc` ( `id` bigint(20) UNSIGNED NOT NULL, `idlinhvuc` bigint(20) NOT NULL, `tenchuyenmuc` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `chuyenmuc` -- INSERT INTO `chuyenmuc` (`id`, `idlinhvuc`, `tenchuyenmuc`, `created_at`, `updated_at`) VALUES (1, 2, 'Xe và Đời sống', '2021-04-23 07:09:02', '2021-04-23 07:09:13'), (2, 1, 'Sức khỏe gia đình', '2021-04-23 07:09:39', '2021-04-23 07:09:39'); -- -------------------------------------------------------- -- -- Table structure for table `congty` -- CREATE TABLE `congty` ( `id` bigint(20) UNSIGNED NOT NULL, `idso` bigint(20) NOT NULL, `idlinhvuc` bigint(20) NOT NULL, `tencongty` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `diachicongty` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `emailcongty` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `dienthoaicongty` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `faxcongty` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `webcongty` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `sdkkdcongty` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `ngaycapdkkdcongty` date NOT NULL, `noicapdkkdcongty` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `masothuecongty` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `ngaythanhlapcongty` date NOT NULL, `subdomain` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `congty` -- INSERT INTO `congty` (`id`, `idso`, `idlinhvuc`, `tencongty`, `diachicongty`, `emailcongty`, `dienthoaicongty`, `faxcongty`, `webcongty`, `sdkkdcongty`, `ngaycapdkkdcongty`, `noicapdkkdcongty`, `masothuecongty`, `ngaythanhlapcongty`, `subdomain`, `created_at`, `updated_at`) VALUES (1, 1, 1, 'Tập đoàn VinGroup', '<NAME>, <NAME>', '<EMAIL>', '1234567890', '1234567890', 'http://www.vingroup.etc.vn', '258147963', '2021-04-06', 'Vĩnh Long', '100225566', '2021-04-28', 'vingroup', NULL, '2021-05-28 17:16:20'), (2, 2, 2, 'Công ty <NAME>', '<NAME>', '<EMAIL>', NULL, NULL, 'https://www.ctyhaisan.vn', '123123123', '2021-04-12', '<NAME>', '12123565', '2021-05-18', NULL, NULL, '2021-05-30 13:17:28'); -- -------------------------------------------------------- -- -- Table structure for table `danhgia` -- CREATE TABLE `danhgia` ( `id` bigint(20) UNSIGNED NOT NULL, `idtaikhoan` bigint(20) NOT NULL, `idsanpham` bigint(20) NOT NULL, `thoigiandanhgia` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `saodanhgia` int(11) NOT NULL, `noidungdanhgia` text COLLATE utf8mb4_unicode_ci NOT NULL, `trangthaidanhgia` int(11) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `failed_jobs` -- CREATE TABLE `failed_jobs` ( `id` bigint(20) UNSIGNED NOT NULL, `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `giaidoan` -- CREATE TABLE `giaidoan` ( `id` bigint(20) UNSIGNED NOT NULL, `idsanpham` bigint(20) NOT NULL, `idtaikhoan` bigint(20) NOT NULL, `tengiaidoan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `thoigiantao` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `motagiaidoan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `giaidoan` -- INSERT INTO `giaidoan` (`id`, `idsanpham`, `idtaikhoan`, `tengiaidoan`, `thoigiantao`, `motagiaidoan`, `created_at`, `updated_at`) VALUES (1, 24, 2, 'Giai đoạn 1', '2021-05-17 13:16:16', 'Giai đoạn tiền xử lý', '2021-05-17 13:16:16', '2021-05-17 13:16:16'), (3, 24, 2, 'Giai đoạn 2', '2021-05-18 08:12:52', 'Giai đoạn quan trọng', '2021-05-18 08:12:52', '2021-05-18 08:12:52'); -- -------------------------------------------------------- -- -- Table structure for table `hinhanh` -- CREATE TABLE `hinhanh` ( `id` bigint(20) UNSIGNED NOT NULL, `idsanpham` bigint(20) DEFAULT NULL, `iddanhgia` bigint(20) DEFAULT NULL, `dulieuhinh` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `hinhanh` -- INSERT INTO `hinhanh` (`id`, `idsanpham`, `iddanhgia`, `dulieuhinh`, `created_at`, `updated_at`) VALUES (4, 2, NULL, '/storage/product/detail-images/1/zen75SEfVYwhe58iohRd.jpg', '2021-04-25 06:31:13', '2021-04-25 06:31:13'), (5, 2, NULL, '/storage/product/detail-images/1/zbrjBTcHIr4muWM7fL26.jpg', '2021-04-25 06:31:13', '2021-04-25 06:31:13'), (6, 21, NULL, '/storage/product/detail-images/1/nZ8rzoFAnEzeyfl77ffk.jpg', '2021-04-27 09:36:04', '2021-04-27 09:36:04'), (7, 22, NULL, '/storage/product/detail-images/1/RhnZvJ98y0UTsJSEAVAk.jpg', '2021-04-27 09:50:20', '2021-04-27 09:50:20'), (8, 23, NULL, '/storage/product/detail-images/1/FHAtjcwSxc9e9VUj7MOv.jpg', '2021-04-27 10:05:54', '2021-04-27 10:05:54'), (9, 24, NULL, '/storage/product/detail-images/2/xwvE1IgZge3baXGZRI5G.jpg', '2021-04-28 04:52:24', '2021-04-28 04:52:24'), (10, 24, NULL, '/storage/product/detail-images/2/kjpGM1YMKbBtbPvs7lyq.jpg', '2021-04-28 04:52:24', '2021-04-28 04:52:24'), (13, 25, NULL, '/storage/product/detail-images/2/67gxJIFfDk7Rv5exdt2o.jpg', '2021-05-18 16:02:42', '2021-05-18 16:02:42'), (14, 25, NULL, '/storage/product/detail-images/2/3AE3KSfhwXxN3cBCaLlJ.jpg', '2021-05-18 16:02:42', '2021-05-18 16:02:42'), (15, 27, NULL, '/storage/product/detail-images/2/NenKLp6dOjIeDDS0PoMB.jpg', '2021-05-18 16:11:20', '2021-05-18 16:11:20'), (16, 27, NULL, '/storage/product/detail-images/2/SAb9GYqn0sJX0AinfGcr.jpg', '2021-05-18 16:11:20', '2021-05-18 16:11:20'), (17, 28, NULL, '/storage/product/detail-images/2/neYLBtXAkitnq7MubFvj.jpg', '2021-05-18 16:12:40', '2021-05-18 16:12:40'), (18, 28, NULL, '/storage/product/detail-images/2/Sq8cdJlTlCAGN2zQdkdB.jpg', '2021-05-18 16:12:40', '2021-05-18 16:12:40'), (19, 29, NULL, '/storage/product/detail-images/2/MJtMIXABLqYAbkcN3YFd.jpg', '2021-05-18 16:42:17', '2021-05-18 16:42:17'), (20, 29, NULL, '/storage/product/detail-images/2/UlzvLH52ZNxJ47tH1rNA.jpg', '2021-05-18 16:42:17', '2021-05-18 16:42:17'); -- -------------------------------------------------------- -- -- Table structure for table `kho` -- CREATE TABLE `kho` ( `id` bigint(20) UNSIGNED NOT NULL, `idcongty` bigint(20) NOT NULL, `idtaikhoan` bigint(20) NOT NULL, `tenkho` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `diachikho` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `taitrongkho` int(11) NOT NULL, `dientichkho` int(11) NOT NULL, `sonhanvienkho` int(11) NOT NULL, `ghichukho` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `kho` -- INSERT INTO `kho` (`id`, `idcongty`, `idtaikhoan`, `tenkho`, `diachikho`, `taitrongkho`, `dientichkho`, `sonhanvienkho`, `ghichukho`, `created_at`, `updated_at`) VALUES (1, 1, 28, 'Kho hàng 2', '<NAME>, <NAME>, <NAME>', 1000, 1000, 20, 'Lưu trữ hàng hóa có giá trị', '2021-04-25 04:18:18', '2021-04-25 04:26:32'), (2, 2, 2, 'Kho hàng test', 'Cần Thơ2', 13333, 1232, 22, 'Kho hàng test', '2021-04-28 04:51:43', '2021-05-28 16:00:58'), (3, 2, 2, 'sdasd', 'xC', 54, 42, 55, 'ac', '2021-04-28 08:31:18', '2021-04-28 08:31:18'); -- -------------------------------------------------------- -- -- Table structure for table `lichsutintuc` -- CREATE TABLE `lichsutintuc` ( `id` bigint(20) UNSIGNED NOT NULL, `idtintuc` bigint(20) NOT NULL, `idtaikhoan` bigint(20) NOT NULL, `lydogo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `thoigian` datetime NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `lichsutintuc` -- INSERT INTO `lichsutintuc` (`id`, `idtintuc`, `idtaikhoan`, `lydogo`, `thoigian`, `created_at`, `updated_at`) VALUES (1, 12, 0, 'gfgdgfg', '2021-05-28 23:59:42', NULL, NULL), (2, 11, 0, '23232', '2021-05-29 00:00:42', NULL, NULL), (3, 12, 0, 'wewewew', '2021-05-29 09:10:32', NULL, NULL), (4, 12, 0, '123', '2021-05-30 09:15:52', NULL, NULL), (5, 12, 0, 'Sai sot thông tin', '2021-06-01 20:23:46', NULL, NULL), (6, 13, 0, 'Sai sot thông tin', '2021-06-01 20:49:24', NULL, NULL), (7, 13, 0, 'sa', '2021-06-01 20:49:36', NULL, NULL), (8, 13, 0, 'Sai sot thông tin', '2021-06-01 20:53:51', NULL, NULL), (9, 4, 0, 'gdfg', '2021-06-01 20:56:50', NULL, NULL), (10, 13, 0, 'Sai sot thông tin', '2021-06-02 20:54:27', NULL, NULL), (11, 13, 28, 'Sai sot thông tin', '2021-06-02 21:03:44', NULL, NULL), (12, 3, 28, 'Sai sot thông tin', '2021-06-02 21:07:13', NULL, NULL), (13, 14, 28, 'dá', '2021-06-02 21:53:59', NULL, NULL), (14, 14, 2, 'Sai sot thông tin', '2021-06-02 21:55:28', NULL, NULL), (15, 14, 2, 'dsafacd', '2021-06-02 21:55:47', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `linhvuc` -- CREATE TABLE `linhvuc` ( `id` bigint(20) UNSIGNED NOT NULL, `tenlinhvuc` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `motalinhvuc` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `linhvuc` -- INSERT INTO `linhvuc` (`id`, `tenlinhvuc`, `motalinhvuc`, `created_at`, `updated_at`) VALUES (1, 'Khoa học', 'Khoa học Cần Thơ', '2021-04-23 07:08:03', '2021-05-30 03:24:41'), (2, 'Công nghệ', 'Công nghệ Cần Thơ', '2021-04-23 07:08:16', '2021-05-30 03:24:52'); -- -------------------------------------------------------- -- -- Table structure for table `loaisanpham` -- CREATE TABLE `loaisanpham` ( `id` bigint(20) UNSIGNED NOT NULL, `idcongty` bigint(20) NOT NULL, `tenloaisanpham` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `motaloaisanpham` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `loaisanpham` -- INSERT INTO `loaisanpham` (`id`, `idcongty`, `tenloaisanpham`, `motaloaisanpham`, `created_at`, `updated_at`) VALUES (1, 1, 'Sửa cho bé', 'Sửa cho bé', '2021-04-25 04:44:41', '2021-05-30 14:17:55'), (2, 2, 'Điện thoại thông minh', 'Điện thoại', '2021-04-28 04:51:09', '2021-04-28 04:51:09'), (3, 2, 'afa', 'fsfa', '2021-04-28 08:27:31', '2021-04-28 08:27:31'); -- -------------------------------------------------------- -- -- Table structure for table `logtintuc` -- CREATE TABLE `logtintuc` ( `id` bigint(20) NOT NULL, `idtintuc` bigint(20) NOT NULL, `idtaikhoan` bigint(20) NOT NULL, `noidungdanhgia` varchar(255) NOT NULL, `thoigian` timestamp NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `logtintuc` -- INSERT INTO `logtintuc` (`id`, `idtintuc`, `idtaikhoan`, `noidungdanhgia`, `thoigian`) VALUES (2, 13, 28, 'Duyệt tin: tin viet rat hay', '2021-06-02 13:55:01'), (3, 13, 28, 'Xuất bản: tin viet rat hay', '2021-06-02 13:58:53'), (4, 14, 28, 'Duyệt tin: tin viet rat hay', '2021-06-02 14:20:57'), (5, 14, 28, 'Xuất bản: tin viet rat hay', '2021-06-02 14:21:02'), (6, 4, 28, 'Xuất bản: tin viet rat hay', '2021-06-02 14:24:41'), (7, 14, 2, 'Duyệt tin: viet sai chinh ta', '2021-06-02 14:54:52'), (8, 14, 2, 'Xuất bản: tin tốt', '2021-06-02 14:55:08'), (9, 14, 2, 'Duyệt tin: sadasdadsa', '2021-06-02 14:55:38'), (10, 14, 2, 'Duyệt tin: fvdg', '2021-06-02 14:55:55'); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (157, '2014_10_12_000000_create_users_table', 1), (158, '2014_10_12_100000_create_password_resets_table', 1), (159, '2019_08_19_000000_create_failed_jobs_table', 1), (160, '2021_04_14_151913_create_so_table', 1), (161, '2021_04_14_152133_create_linhvuc_table', 1), (162, '2021_04_14_152217_create_chuyenmuc_table', 1), (163, '2021_04_14_152301_create_tintuc_table', 1), (164, '2021_04_14_152623_create_congty_table', 1), (165, '2021_04_14_152842_create_kho_table', 1), (166, '2021_04_14_153746_create_loaisanpham_table', 1), (167, '2021_04_14_153837_create_sanpham_table', 1), (168, '2021_04_14_164914_create_thongtin_table', 1), (169, '2021_04_23_103346_create_hinhanh_table', 1), (170, '2021_04_23_103400_create_video_table', 1), (171, '2021_04_23_104049_create_danhgia_table', 1), (172, '2021_04_23_105605_create_giaidoan_table', 1), (173, '2021_04_23_105801_create_thongtingiaidoan_table', 1), (174, '2021_04_23_110056_create_quyen_table', 1), (175, '2021_04_23_110257_create_vaitro_table', 1), (176, '2021_04_23_110332_create_vaitro_quyen_table', 1), (177, '2021_04_23_110424_create_taikhoan_vaitro_table', 1), (178, '2014_10_12_200000_add_two_factor_columns_to_users_table', 2), (179, '2021_05_15_014853_create_lichsutintuc_table', 3); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `password_resets` -- INSERT INTO `password_resets` (`email`, `token`, `created_at`) VALUES ('<EMAIL>', <PASSWORD>', '2021-05-28 06:07:24'), ('<EMAIL>', <PASSWORD>', '2021-05-28 08:54:10'); -- -------------------------------------------------------- -- -- Table structure for table `quyen` -- CREATE TABLE `quyen` ( `id` bigint(20) UNSIGNED NOT NULL, `parent_id` bigint(20) NOT NULL, `tenquyen` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `motaquyen` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `trangthai` smallint(6) NOT NULL DEFAULT '0' COMMENT '1-on, 0-off', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `quyen` -- INSERT INTO `quyen` (`id`, `parent_id`, `tenquyen`, `motaquyen`, `trangthai`, `created_at`, `updated_at`) VALUES (1, 0, 'category', 'Chuyên mục', 0, '2021-04-29 21:01:43', '2021-05-28 17:19:38'), (2, 1, 'category-list', 'Danh sách', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (3, 1, 'category-view', 'Xem', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (4, 1, 'category-add', 'Thêm', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (5, 1, 'category-update', 'Sửa', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (6, 1, 'category-delete', 'Xóa', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (7, 0, 'company', 'Công ty', 1, '2021-04-29 21:01:43', '2021-05-20 15:16:49'), (8, 7, 'company-list', 'Danh sách', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (9, 7, 'company-view', 'Xem', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (10, 7, 'company-add', 'Thêm', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (11, 7, 'company-update', 'Sửa', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (12, 7, 'company-delete', 'Xóa', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (13, 0, 'comment', '<NAME>', 1, '2021-04-29 21:01:43', '2021-05-20 15:17:49'), (14, 13, 'comment-list', 'Danh sách', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (15, 13, 'comment-view', 'Xem', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (16, 13, 'comment-add', 'Thêm', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (17, 13, 'comment-update', 'Sửa', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (18, 13, 'comment-delete', 'Xóa', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (19, 0, 'stage', 'Giai đoạn', 1, '2021-04-29 21:01:43', '2021-04-29 21:03:15'), (20, 19, 'stage-list', 'Danh sách', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (21, 19, 'stage-view', 'Xem', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (22, 19, 'stage-add', 'Thêm', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (23, 19, 'stage-update', 'Sửa', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (24, 19, 'stage-delete', 'Xóa', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (25, 0, 'storage', 'Kho', 1, '2021-04-29 21:01:43', '2021-04-29 21:03:16'), (26, 25, 'storage-list', 'Danh sách', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (27, 25, 'storage-view', 'Xem', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (28, 25, 'storage-add', 'Thêm', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (29, 25, 'storage-update', 'Sửa', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (30, 25, 'storage-delete', 'Xóa', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (31, 0, 'field', 'Lĩnh vực', 0, '2021-04-29 21:01:43', '2021-05-20 15:09:01'), (32, 31, 'field-list', 'Danh sách', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (33, 31, 'field-view', 'Xem', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (34, 31, 'field-add', 'Thêm', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (35, 31, 'field-update', 'Sửa', 0, '2021-04-29 21:01:43', '2021-04-29 21:01:43'), (36, 31, 'field-delete', 'Xóa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (37, 0, 'procat', 'Loại sản phẩm', 1, '2021-04-29 21:01:44', '2021-04-29 21:03:21'), (38, 37, 'procat-list', 'Danh sách', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (39, 37, 'procat-view', 'Xem', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (40, 37, 'procat-add', 'Thêm', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (41, 37, 'procat-update', 'Sửa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (42, 37, 'procat-delete', 'Xóa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (43, 0, 'permission', 'Quyền', 0, '2021-04-29 21:01:44', '2021-05-20 15:11:18'), (44, 43, 'permission-list', 'Danh sách', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (45, 43, 'permission-view', 'Xem', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (46, 43, 'permission-add', 'Thêm', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (47, 43, 'permission-update', 'Sửa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (48, 43, 'permission-delete', 'Xóa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (49, 0, 'product', 'Sản phẩm', 1, '2021-04-29 21:01:44', '2021-04-29 21:03:22'), (50, 49, 'product-list', 'Danh sách', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (51, 49, 'product-view', 'Xem', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (52, 49, 'product-add', 'Thêm', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (53, 49, 'product-update', 'Sửa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (54, 49, 'product-delete', 'Xóa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (55, 0, 'department', 'Sở', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (56, 55, 'department-list', 'Danh sách', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (57, 55, 'department-view', 'Xem', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (58, 55, 'department-add', 'Thêm', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (59, 55, 'department-update', 'Sửa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (60, 55, 'department-delete', 'Xóa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (61, 0, 'account', 'Tài khoản', 1, '2021-04-29 21:01:44', '2021-04-29 21:03:25'), (62, 61, 'account-list', 'Danh sách', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (63, 61, 'account-view', 'Xem', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (64, 61, 'account-add', 'Thêm', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (65, 61, 'account-update', 'Sửa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (66, 61, 'account-delete', 'Xóa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (67, 0, 'role', 'Vai trò', 1, '2021-04-29 21:01:44', '2021-04-29 21:03:24'), (68, 67, 'role-list', 'Danh sách', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (69, 67, 'role-view', 'Xem', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (70, 67, 'role-add', 'Thêm', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (71, 67, 'role-update', 'Sửa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (72, 67, 'role-delete', 'Xóa', 0, '2021-04-29 21:01:44', '2021-04-29 21:01:44'), (73, 0, 'news', 'Tin tức', 1, '2021-04-29 21:02:00', '2021-04-29 21:03:27'), (74, 73, 'news-list', 'Danh sách', 0, '2021-04-29 21:02:00', '2021-04-29 21:02:00'), (75, 73, 'news-view', 'Xem', 0, '2021-04-29 21:02:00', '2021-04-29 21:02:00'), (76, 73, 'news-add', 'Thêm', 0, '2021-04-29 21:02:00', '2021-04-29 21:02:00'), (77, 73, 'news-update', 'Sửa', 0, '2021-04-29 21:02:00', '2021-04-29 21:02:00'), (78, 73, 'news-delete', 'Xóa', 0, '2021-04-29 21:02:00', '2021-04-29 21:02:00'), (79, 73, 'news-browse', 'Duyệt bài', 0, '2021-04-29 21:02:00', '2021-04-29 21:02:00'), (80, 73, 'news-publish', 'Xuất bản', 0, '2021-04-29 21:02:00', '2021-04-29 21:02:00'), (81, 19, 'stage-browse', 'Duyệt bài', 0, '2021-04-30 02:03:45', '2021-04-30 02:03:45'), (82, 19, 'stage-publish', 'Xuất bản', 0, '2021-04-30 02:03:45', '2021-04-30 02:03:45'); -- -------------------------------------------------------- -- -- Table structure for table `sanpham` -- CREATE TABLE `sanpham` ( `id` bigint(20) UNSIGNED NOT NULL, `idloaisanpham` bigint(20) NOT NULL, `idcongty` bigint(20) NOT NULL, `idtaikhoan` bigint(20) NOT NULL, `idkho` bigint(20) NOT NULL, `tensanpham` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `thongtinsanpham` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `hinhanhsanpham` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `xuatxu` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `chungloaisanpham` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `dongiasanpham` int(11) NOT NULL, `khoiluongsanpham` int(11) NOT NULL, `donvitinhsanpham` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `mavachsanpham` longtext COLLATE utf8mb4_unicode_ci, `qrcode` longtext COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `sanpham` -- INSERT INTO `sanpham` (`id`, `idloaisanpham`, `idcongty`, `idtaikhoan`, `idkho`, `tensanpham`, `thongtinsanpham`, `hinhanhsanpham`, `xuatxu`, `chungloaisanpham`, `dongiasanpham`, `khoiluongsanpham`, `donvitinhsanpham`, `mavachsanpham`, `qrcode`, `created_at`, `updated_at`) VALUES (22, 1, 1, 2, 1, '123123213123', '<p>213213121</p>', '/storage/product/images/1/RhgJ44Kjd8edpvMSikeE.jpg', '3313', '1232uuhuhuhuhu', 221321, 123, '21321', '<div style=\"font-size:0;position:relative;width:384px;height:50px;\">\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:0px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:8px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:12px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:20px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:28px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:32px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:40px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:48px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:52px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:56px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:64px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:68px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:80px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:84px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:88px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:96px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:104px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:116px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:120px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:124px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:128px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:132px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:140px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:148px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:152px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:160px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:168px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:176px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:184px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:188px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:192px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:196px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:208px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:216px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:220px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:224px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:228px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:236px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:240px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:248px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:256px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:264px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:272px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:276px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:284px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:288px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:292px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:304px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:308px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:316px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:320px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:324px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:336px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:340px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:344px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:352px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:360px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:364px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:372px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:380px;top:0px;\">&nbsp;</div>\n<div style=\"position:absolute;bottom:0; text-align:center; width:384px; font-size: 0.6vw;\">123456789</div></div>\n', NULL, '2021-04-27 09:50:20', '2021-05-30 14:36:49'), (23, 1, 1, 2, 1, '3213', '<p>1233213131</p>', '/storage/product/images/1/etqDuVSJAI13auNzxl81.jpg', '312', '131', 123, 123, '12', '<div style=\"font-size:0;position:relative;width:160px;height:50px;\">\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:0px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:8px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:12px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:20px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:28px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:32px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:36px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:48px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:52px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:56px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:64px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:72px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:84px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:88px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:92px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:96px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:104px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:112px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:120px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:124px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:128px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:136px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:140px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:148px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:156px;top:0px;\">&nbsp;</div>\n<div style=\"position:absolute;bottom:0; text-align:center; width:160px; font-size: 0.6vw;\">23</div></div>\n', NULL, '2021-04-27 10:05:54', '2021-04-27 10:05:54'), (24, 2, 2, 28, 2, 'sada32313132132213', '<p>đsd&aacute;d&aacute;dad&aacute;d&aacute;d&aacute;d&aacute;da<img src=\"/storage/photos/2/176574504_854070525321983_4520952125878837461_n.jpg\" alt=\"\" width=\"1365\" height=\"2048\" /></p>', '/storage/product/images/2/VV8r340sRjTUgSkdlIis.jpg', 'dsadá', 'ádsadadsa321312321321', 123, 12312, '1321', '<div style=\"font-size:0;position:relative;width:160px;height:50px;\">\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:0px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:8px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:12px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:20px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:28px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:32px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:36px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:48px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:52px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:56px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:64px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:68px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:76px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:84px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:88px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:96px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:100px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:112px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:120px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:124px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:128px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:136px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:140px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:148px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:156px;top:0px;\">&nbsp;</div>\n<div style=\"position:absolute;bottom:0; text-align:center; width:160px; font-size: 0.6vw;\">24</div></div>\n', NULL, '2021-04-28 04:52:24', '2021-05-18 03:19:26'), (27, 3, 2, 2, 3, '1232131231213', '2321wqeqêwqeqe', '/storage/product/images/2/tIms845W7pQni8Erl3T8.jpg', '213123', '123123313123123', 123131, 12313, 'ewqewqewqe', '<div style=\"font-size:0;position:relative;width:448px;height:50px;\">\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:0px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:8px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:12px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:20px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:28px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:32px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:40px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:48px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:52px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:56px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:64px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:68px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:80px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:84px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:88px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:96px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:104px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:116px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:120px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:124px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:128px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:136px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:144px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:148px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:152px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:160px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:168px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:180px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:184px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:188px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:192px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:200px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:208px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:212px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:216px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:224px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:228px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:240px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:244px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:248px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:256px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:264px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:276px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:280px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:284px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:288px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:292px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:304px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:308px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:312px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:320px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:328px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:336px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:340px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:344px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:352px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:360px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:372px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:376px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:380px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:384px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:392px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:400px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:404px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:412px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:416px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:424px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:428px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:6px;height:38px;position:absolute;left:436px;top:0px;\">&nbsp;</div>\n<div style=\"background-color:black;width:2px;height:38px;position:absolute;left:444px;top:0px;\">&nbsp;</div>\n<div style=\"position:absolute;bottom:0; text-align:center; width:448px; font-size: 0.6vw;\">12313123213</div></div>\n', NULL, '2021-05-18 16:11:20', '2021-05-18 16:11:20'); -- -------------------------------------------------------- -- -- Table structure for table `so` -- CREATE TABLE `so` ( `id` bigint(20) UNSIGNED NOT NULL, `tenso` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `diachiso` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `emailso` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `dienthoaiso` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `faxso` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `webso` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `so` -- INSERT INTO `so` (`id`, `tenso`, `diachiso`, `emailso`, `dienthoaiso`, `faxso`, `webso`, `created_at`, `updated_at`) VALUES (1, 'K<NAME>', '<NAME>', '<EMAIL>', NULL, NULL, 'http://www.aaa.etc.vn', '2021-04-23 07:06:38', '2021-05-30 13:20:33'), (2, 'C<NAME>', '<NAME>', '<EMAIL>', '987654321', '987654321', 'http://www.ctct.etc.vn', '2021-04-23 07:07:17', '2021-05-30 03:21:28'), (5, 'Sở địa chính', 'C<NAME>', '<EMAIL>', '0987654321', '0987654321', 'https://diachinh.com', '2021-05-04 14:40:02', '2021-05-30 03:21:41'); -- -------------------------------------------------------- -- -- Table structure for table `taikhoan_vaitro` -- CREATE TABLE `taikhoan_vaitro` ( `id` bigint(20) UNSIGNED NOT NULL, `idtaikhoan` bigint(20) NOT NULL, `idvaitro` bigint(20) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `taikhoan_vaitro` -- INSERT INTO `taikhoan_vaitro` (`id`, `idtaikhoan`, `idvaitro`, `created_at`, `updated_at`) VALUES (1, 10, 1, NULL, NULL), (2, 10, 2, NULL, NULL), (3, 11, 1, NULL, NULL), (4, 11, 2, NULL, NULL), (5, 12, 1, NULL, NULL), (6, 16, 1, NULL, NULL), (9, 16, 2, NULL, NULL), (12, 4, 6, NULL, NULL), (15, 20, 3, NULL, NULL), (16, 21, 3, NULL, NULL), (17, 22, 3, NULL, NULL), (19, 23, 6, NULL, NULL), (20, 23, 5, NULL, NULL), (21, 24, 3, NULL, NULL), (25, 28, 12, NULL, NULL), (26, 1, 1, NULL, NULL), (27, 2, 2, NULL, NULL), (28, 35, 2, NULL, NULL), (29, 36, 2, NULL, NULL), (30, 37, 2, NULL, NULL), (31, 38, 2, NULL, NULL), (32, 28, 13, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `thongtin` -- CREATE TABLE `thongtin` ( `id` bigint(20) UNSIGNED NOT NULL, `idtaikhoan` bigint(20) NOT NULL, `hothanhvien` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `tenthanhvien` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `gioitinhthanhvien` smallint(6) DEFAULT NULL, `hinhanhthanhvien` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `namsinh` date DEFAULT NULL, `diachi` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dienthoai` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `thongtin` -- INSERT INTO `thongtin` (`id`, `idtaikhoan`, `hothanhvien`, `tenthanhvien`, `gioitinhthanhvien`, `hinhanhthanhvien`, `namsinh`, `diachi`, `dienthoai`, `created_at`, `updated_at`) VALUES (1, 1, 'Nguyễn', 'Huy', 1, '/storage/profile/1/m5nElWaHjYC5YGmDzr5u.jpg', '1999-12-07', 'Vĩnh Long', '0938858944', '2021-04-23 07:00:25', '2021-04-27 11:56:12'), (2, 2, 'Nguyễn', 'Huy', 1, '/storage/profile/2/RpiixNGJM4pwTrfd1jRg.jpg', '1999-12-07', 'kkj', '4545621315', '2021-04-24 21:00:06', '2021-05-30 13:27:05'), (3, 3, 'Trần', 'Tú', 1, '/storage/profile/3/UL9bFa5gVjogBcLbvUMJ.jpg', '2021-03-30', '<NAME>', '0122558866', '2021-04-25 20:38:25', '2021-04-25 20:57:35'), (4, 4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-25 20:58:25', '2021-04-25 20:58:25'), (6, 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-25 21:58:56', '2021-04-25 21:58:56'), (7, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-25 22:08:21', '2021-04-25 22:08:21'), (8, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-25 23:42:39', '2021-04-25 23:42:39'), (9, 11, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-25 23:48:05', '2021-04-25 23:48:05'), (10, 12, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-25 23:55:24', '2021-04-25 23:55:24'), (11, 13, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-25 23:56:00', '2021-04-25 23:56:00'), (12, 14, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-25 23:59:35', '2021-04-25 23:59:35'), (13, 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-26 00:03:07', '2021-04-26 00:03:07'), (14, 16, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-26 00:04:07', '2021-04-26 00:04:07'), (16, 20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-28 04:32:09', '2021-04-28 04:32:09'), (17, 21, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-28 04:32:40', '2021-04-28 04:32:40'), (18, 22, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-28 04:33:31', '2021-04-28 04:33:31'), (19, 23, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-28 04:36:44', '2021-04-28 04:36:44'), (20, 24, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-04-28 04:44:50', '2021-04-28 04:44:50'), (21, 28, 'ABC', 'ACAC', 1, NULL, '2021-04-06', 'acac', '413123', '2021-04-28 07:20:59', '2021-04-28 07:22:20'), (26, 35, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-05-15 17:16:02', '2021-05-15 17:16:02'), (27, 36, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-05-18 11:01:27', '2021-05-18 11:01:27'), (28, 37, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-05-18 11:06:36', '2021-05-18 11:06:36'), (30, 47, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-05-28 14:53:14', '2021-05-28 14:53:14'); -- -------------------------------------------------------- -- -- Table structure for table `thongtingiaidoan` -- CREATE TABLE `thongtingiaidoan` ( `id` bigint(20) UNSIGNED NOT NULL, `idgiaidoan` bigint(20) NOT NULL, `motacongviec` text COLLATE utf8mb4_unicode_ci NOT NULL, `tencongviec` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `thoigianbatdau` date NOT NULL, `thoigiandukien` int(11) NOT NULL, `thoigianhoanthanh` date NOT NULL, `trehan` int(11) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `thongtingiaidoan` -- INSERT INTO `thongtingiaidoan` (`id`, `idgiaidoan`, `motacongviec`, `tencongviec`, `thoigianbatdau`, `thoigiandukien`, `thoigianhoanthanh`, `trehan`, `created_at`, `updated_at`) VALUES (4, 1, '<p>;ijopijp</p>', 'ihlhklgk', '2021-05-18', 45, '2021-05-28', 4, '2021-05-19 15:11:56', '2021-05-19 15:11:56'), (5, 1, '<p>8908989</p>', 'ipipip', '2021-05-18', 9, '2021-05-20', 9, '2021-05-19 16:09:29', '2021-05-19 16:09:29'), (6, 1, '<p>0890</p>', 'po\'op\'o', '2021-05-18', 9, '2021-05-21', 90, '2021-05-19 16:09:29', '2021-05-19 16:09:29'); -- -------------------------------------------------------- -- -- Table structure for table `tintuc` -- CREATE TABLE `tintuc` ( `id` bigint(20) UNSIGNED NOT NULL, `idchuyenmuc` bigint(20) NOT NULL, `idcongty` bigint(20) NOT NULL, `idtaikhoan` bigint(20) NOT NULL, `ngaydangtintuc` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `tieudetintuc` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `tomtattintuc` text COLLATE utf8mb4_unicode_ci NOT NULL, `noidungtintuc` text COLLATE utf8mb4_unicode_ci NOT NULL, `hinhanhtintuc` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `loaitintuc` smallint(6) NOT NULL DEFAULT '0' COMMENT '1-nổi bật, 0-không nổi bật', `duyettintuc` smallint(6) NOT NULL DEFAULT '0' COMMENT '1-đã duyệt, 0-chưa duyệt', `xuatbantintuc` smallint(6) NOT NULL DEFAULT '0' COMMENT '1-duyệt xuất bản, 0-chưa được xuất bản', `lydogo` smallint(6) NOT NULL DEFAULT '0' COMMENT '1-có, 0-không', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `tintuc` -- INSERT INTO `tintuc` (`id`, `idchuyenmuc`, `idcongty`, `idtaikhoan`, `ngaydangtintuc`, `tieudetintuc`, `tomtattintuc`, `noidungtintuc`, `hinhanhtintuc`, `loaitintuc`, `duyettintuc`, `xuatbantintuc`, `lydogo`, `created_at`, `updated_at`) VALUES (1, 1, 2, 2, '2021-05-31 17:01:48', 'tieude', 'tomat', 'dá', '', 1, 0, 0, 0, NULL, NULL), (2, 1, 2, 2, '2021-06-01 13:57:14', 'tieude', 'tomat', 'dá', '', 1, 1, 0, 0, NULL, NULL), (3, 1, 2, 2, '2021-06-02 14:07:13', 'tieude', 'tomat', 'dá', '', 1, 0, 0, 1, NULL, NULL), (4, 1, 2, 2, '2021-06-02 14:24:41', 'tieude', 'tomat', '<p>idgsaudiufvfnfsue</p>', '', 0, 1, 1, 1, NULL, '2021-06-02 14:24:41'), (11, 1, 1, 2, '2021-05-30 04:32:50', 'qeqưewq', 'qưeqưewqe', '<p>132132131313</p>', '/storage/news/image/1/FkgfZT4akohOy0uj0E2q.jpg', 1, 1, 1, 1, NULL, '2021-05-30 02:19:15'), (12, 1, 2, 2, '2021-06-01 13:36:14', 'eqưeqưe', 'qưeqưeqe', '<p>qeqưeqưqưqeq</p>', '/storage/news/image/1/8xZ2LbOdgUcxtpzn4XnH.jpg', 1, 1, 1, 1, NULL, '2021-06-01 13:36:14'), (13, 2, 2, 2, '2021-06-02 14:03:44', 'y656yyus', 'tỷttyrtyr', '<p>y5yrrts</p>', '/hinhanh/91535.white_gray_cell.jpg', 0, 0, 0, 1, NULL, NULL), (14, 1, 2, 28, '2021-06-03 06:19:12', 'da', '<p>gvdffgdf</p>', '<p>đáasdadsa</p>', '/storage/news/image/28/hSxSrWqTTBNDMln5ASoN.jpg', 0, 0, 0, 1, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `idcongty` bigint(20) DEFAULT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `two_factor_secret` text COLLATE utf8mb4_unicode_ci, `two_factor_recovery_codes` text COLLATE utf8mb4_unicode_ci, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `loaitaikhoan` smallint(6) NOT NULL DEFAULT '0' COMMENT '1-admin, 0-normal, 2-administrator', `trangthai` smallint(6) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `idcongty`, `email`, `email_verified_at`, `password`, `two_factor_secret`, `two_factor_recovery_codes`, `remember_token`, `loaitaikhoan`, `trangthai`, `created_at`, `updated_at`) VALUES (1, NULL, '<EMAIL>', '2021-05-28 14:57:46', '$2y$10$vFxTKDYsc5xa6LW1UxdTZeeF5Sbk2dzL8kkh/1TUERQnp1nawEULu', NULL, NULL, NULL, 2, 0, NULL, '2021-05-26 16:21:16'), (2, 2, '<EMAIL>', '2021-05-28 14:57:46', '$2y$10$vFxTKDYsc5xa6LW1UxdTZeeF5Sbk2dzL8kkh/1TUERQnp1nawEULu', NULL, NULL, 'rRvw7ohtz7WQsYa4e0FCyzgH39lcz3onH7zuDqFGQuwSv9ws2aEwV5B6LyOs', 1, 0, NULL, '2021-05-27 15:19:35'), (28, 2, '<EMAIL>', '2021-05-28 14:57:46', '$2y$10$vFxTKDYsc5xa6LW1UxdTZeeF5Sbk2dzL8kkh/1TUERQnp1nawEULu', NULL, NULL, NULL, 1, 0, '2021-04-28 07:20:59', '2021-05-04 14:27:22'), (36, NULL, '<EMAIL>', '2021-05-28 14:57:46', '$2y$10$dwkz7Fr6NzxHwA7n9XUnwOqdDGjIMgNm.mjlrwko9yJO0PfH.cGF2', NULL, NULL, NULL, 1, 0, '2021-05-18 11:01:26', '2021-05-18 11:02:31'), (37, NULL, '<EMAIL>', '2021-05-28 14:57:46', '$2y$10$JoBQ0bj7qN6YvW/4xNoM.eMZO.hOinupFaXyJwlZ.O2Q6S5SN1VU.', NULL, NULL, NULL, 1, 0, '2021-05-18 11:06:36', '2021-05-18 11:08:46'), (47, NULL, '<EMAIL>', '2021-05-28 14:57:46', '$2y$10$yBhLxLXqcvLvGKvpn4eDfOeHBQg45rTZSdf8wWgbzGTKSfPWvTZ3m', NULL, NULL, 'gBmDZqvfdKXRcsXDPTcgfiIkICj3RBuBqeQZ9MbuNcDAM5a8eMOK2LjWP5hz', 0, 0, '2021-05-28 14:53:09', '2021-05-28 15:22:11'); -- -------------------------------------------------------- -- -- Table structure for table `vaitro` -- CREATE TABLE `vaitro` ( `id` bigint(20) UNSIGNED NOT NULL, `idcongty` bigint(20) DEFAULT NULL, `tenvaitro` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `motavaitro` text COLLATE utf8mb4_unicode_ci NOT NULL, `loaivaitro` smallint(6) DEFAULT NULL COMMENT '1-administrator, 2-company', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `vaitro` -- INSERT INTO `vaitro` (`id`, `idcongty`, `tenvaitro`, `motavaitro`, `loaivaitro`, `created_at`, `updated_at`) VALUES (1, NULL, 'System Administrator', '<NAME>', 1, NULL, '2021-04-30 02:01:21'), (2, NULL, 'Company Administrator', 'Quản trị công ty', 2, NULL, '2021-04-30 02:01:49'), (12, 2, 'Test', 'Thử nghiệm', NULL, '2021-04-29 20:39:15', '2021-04-29 20:39:15'), (13, 2, 'Quản lý tin tức', 'Toàn quyền quản trị module tin tức', NULL, '2021-06-02 13:01:41', '2021-06-02 13:01:41'); -- -------------------------------------------------------- -- -- Table structure for table `vaitro_quyen` -- CREATE TABLE `vaitro_quyen` ( `id` bigint(20) UNSIGNED NOT NULL, `idvaitro` bigint(20) NOT NULL, `idquyen` bigint(20) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `vaitro_quyen` -- INSERT INTO `vaitro_quyen` (`id`, `idvaitro`, `idquyen`, `created_at`, `updated_at`) VALUES (1, 1, 2, NULL, NULL), (2, 1, 3, NULL, NULL), (3, 1, 4, NULL, NULL), (4, 1, 5, NULL, NULL), (5, 1, 6, NULL, NULL), (6, 1, 8, NULL, NULL), (7, 1, 9, NULL, NULL), (8, 1, 10, NULL, NULL), (9, 1, 11, NULL, NULL), (10, 1, 12, NULL, NULL), (11, 1, 14, NULL, NULL), (12, 1, 15, NULL, NULL), (13, 1, 16, NULL, NULL), (14, 1, 17, NULL, NULL), (15, 1, 18, NULL, NULL), (16, 1, 20, NULL, NULL), (17, 1, 21, NULL, NULL), (18, 1, 22, NULL, NULL), (19, 1, 23, NULL, NULL), (20, 1, 24, NULL, NULL), (21, 1, 26, NULL, NULL), (22, 1, 27, NULL, NULL), (23, 1, 28, NULL, NULL), (24, 1, 29, NULL, NULL), (25, 1, 30, NULL, NULL), (26, 1, 32, NULL, NULL), (27, 1, 33, NULL, NULL), (28, 1, 34, NULL, NULL), (29, 1, 35, NULL, NULL), (30, 1, 36, NULL, NULL), (31, 1, 38, NULL, NULL), (32, 1, 39, NULL, NULL), (33, 1, 40, NULL, NULL), (34, 1, 41, NULL, NULL), (35, 1, 42, NULL, NULL), (37, 1, 45, NULL, NULL), (38, 1, 46, NULL, NULL), (39, 1, 47, NULL, NULL), (40, 1, 48, NULL, NULL), (41, 1, 50, NULL, NULL), (42, 1, 51, NULL, NULL), (43, 1, 52, NULL, NULL), (44, 1, 53, NULL, NULL), (45, 1, 54, NULL, NULL), (46, 1, 56, NULL, NULL), (47, 1, 57, NULL, NULL), (48, 1, 58, NULL, NULL), (49, 1, 59, NULL, NULL), (50, 1, 60, NULL, NULL), (51, 1, 62, NULL, NULL), (52, 1, 63, NULL, NULL), (53, 1, 64, NULL, NULL), (54, 1, 65, NULL, NULL), (55, 1, 66, NULL, NULL), (56, 1, 68, NULL, NULL), (57, 1, 69, NULL, NULL), (58, 1, 70, NULL, NULL), (59, 1, 71, NULL, NULL), (60, 1, 72, NULL, NULL), (61, 1, 74, NULL, NULL), (62, 1, 75, NULL, NULL), (63, 1, 76, NULL, NULL), (64, 1, 77, NULL, NULL), (65, 1, 78, NULL, NULL), (66, 1, 79, NULL, NULL), (67, 1, 80, NULL, NULL), (68, 2, 8, NULL, NULL), (69, 2, 9, NULL, NULL), (70, 2, 10, NULL, NULL), (71, 2, 11, NULL, NULL), (72, 2, 12, NULL, NULL), (73, 2, 14, NULL, NULL), (74, 2, 15, NULL, NULL), (75, 2, 16, NULL, NULL), (76, 2, 17, NULL, NULL), (77, 2, 18, NULL, NULL), (78, 2, 20, NULL, NULL), (79, 2, 21, NULL, NULL), (80, 2, 22, NULL, NULL), (81, 2, 23, NULL, NULL), (82, 2, 24, NULL, NULL), (83, 2, 26, NULL, NULL), (84, 2, 27, NULL, NULL), (85, 2, 28, NULL, NULL), (86, 2, 29, NULL, NULL), (87, 2, 30, NULL, NULL), (88, 2, 38, NULL, NULL), (89, 2, 39, NULL, NULL), (90, 2, 40, NULL, NULL), (91, 2, 41, NULL, NULL), (92, 2, 42, NULL, NULL), (93, 2, 50, NULL, NULL), (94, 2, 51, NULL, NULL), (95, 2, 52, NULL, NULL), (96, 2, 53, NULL, NULL), (97, 2, 54, NULL, NULL), (98, 2, 62, NULL, NULL), (99, 2, 63, NULL, NULL), (100, 2, 64, NULL, NULL), (101, 2, 65, NULL, NULL), (102, 2, 66, NULL, NULL), (103, 2, 68, NULL, NULL), (104, 2, 69, NULL, NULL), (105, 2, 70, NULL, NULL), (106, 2, 71, NULL, NULL), (107, 2, 72, NULL, NULL), (108, 2, 74, NULL, NULL), (109, 2, 75, NULL, NULL), (110, 2, 76, NULL, NULL), (111, 2, 77, NULL, NULL), (112, 2, 78, NULL, NULL), (113, 2, 79, NULL, NULL), (114, 2, 80, NULL, NULL), (116, 12, 62, NULL, NULL), (117, 12, 63, NULL, NULL), (126, 1, 44, NULL, NULL), (127, 12, 64, NULL, NULL), (128, 1, 81, NULL, NULL), (129, 1, 82, NULL, NULL), (130, 13, 74, NULL, NULL), (131, 13, 75, NULL, NULL), (132, 13, 76, NULL, NULL), (133, 13, 77, NULL, NULL), (134, 13, 78, NULL, NULL), (135, 13, 79, NULL, NULL), (136, 13, 80, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `video` -- CREATE TABLE `video` ( `id` bigint(20) UNSIGNED NOT NULL, `idsanpham` bigint(20) DEFAULT NULL, `idtintuc` bigint(20) DEFAULT NULL, `iddanhgia` bigint(20) DEFAULT NULL, `dulieuvideo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `video` -- INSERT INTO `video` (`id`, `idsanpham`, `idtintuc`, `iddanhgia`, `dulieuvideo`, `created_at`, `updated_at`) VALUES (11, NULL, 11, NULL, '/storage/news/video/1/53mSLglw91JHrxaiQm3x.mp4', '2021-04-27 07:40:54', '2021-04-27 07:40:54'), (19, NULL, 15, NULL, '/storage/news/video/2/X3e4av4hDLcefmuyMbp9.mp4', '2021-04-30 09:15:41', '2021-04-30 09:15:41'), (20, NULL, 15, NULL, '/storage/news/video/2/bVLdn2uJJMNpmjVC6E8i.mp4', '2021-04-30 09:15:41', '2021-04-30 09:15:41'), (21, NULL, 18, NULL, '/video/BMW LOGO [Animate this static!].mp4', NULL, NULL), (22, NULL, 18, NULL, '/video/BMW Logo Intro.mp4', NULL, NULL), (24, NULL, 22, NULL, '/storage/news/video/2/VC6l6UDaR1Wa0fJjFwtS.mp4', '2021-05-30 04:07:24', '2021-05-30 04:07:24'), (25, NULL, 22, NULL, '/storage/news/video/2/ysyOdxHq51MiPbuauqMp.mp4', '2021-05-30 04:07:24', '2021-05-30 04:07:24'), (26, NULL, 23, NULL, '/storage/news/video/2/Q2fC5Cpmqk2AsUKrbY7I.mp4', '2021-05-30 04:10:09', '2021-05-30 04:10:09'), (27, NULL, 23, NULL, '/storage/news/video/2/OH6jGanmD00cQUGxyk40.mp4', '2021-05-30 04:10:09', '2021-05-30 04:10:09'), (28, NULL, 1, NULL, '/video/BMW LOGO [Animate this static!].mp4', NULL, NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `chuyenmuc` -- ALTER TABLE `chuyenmuc` ADD PRIMARY KEY (`id`); -- -- Indexes for table `congty` -- ALTER TABLE `congty` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `subdomain` (`subdomain`); -- -- Indexes for table `danhgia` -- ALTER TABLE `danhgia` ADD PRIMARY KEY (`id`); -- -- Indexes for table `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`); -- -- Indexes for table `giaidoan` -- ALTER TABLE `giaidoan` ADD PRIMARY KEY (`id`); -- -- Indexes for table `hinhanh` -- ALTER TABLE `hinhanh` ADD PRIMARY KEY (`id`); -- -- Indexes for table `kho` -- ALTER TABLE `kho` ADD PRIMARY KEY (`id`); -- -- Indexes for table `lichsutintuc` -- ALTER TABLE `lichsutintuc` ADD PRIMARY KEY (`id`); -- -- Indexes for table `linhvuc` -- ALTER TABLE `linhvuc` ADD PRIMARY KEY (`id`); -- -- Indexes for table `loaisanpham` -- ALTER TABLE `loaisanpham` ADD PRIMARY KEY (`id`); -- -- Indexes for table `logtintuc` -- ALTER TABLE `logtintuc` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `quyen` -- ALTER TABLE `quyen` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `tenquyen` (`tenquyen`); -- -- Indexes for table `sanpham` -- ALTER TABLE `sanpham` ADD PRIMARY KEY (`id`); -- -- Indexes for table `so` -- ALTER TABLE `so` ADD PRIMARY KEY (`id`); -- -- Indexes for table `taikhoan_vaitro` -- ALTER TABLE `taikhoan_vaitro` ADD PRIMARY KEY (`id`); -- -- Indexes for table `thongtin` -- ALTER TABLE `thongtin` ADD PRIMARY KEY (`id`); -- -- Indexes for table `thongtingiaidoan` -- ALTER TABLE `thongtingiaidoan` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tintuc` -- ALTER TABLE `tintuc` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- Indexes for table `vaitro` -- ALTER TABLE `vaitro` ADD PRIMARY KEY (`id`); -- -- Indexes for table `vaitro_quyen` -- ALTER TABLE `vaitro_quyen` ADD PRIMARY KEY (`id`); -- -- Indexes for table `video` -- ALTER TABLE `video` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `chuyenmuc` -- ALTER TABLE `chuyenmuc` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `congty` -- ALTER TABLE `congty` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `danhgia` -- ALTER TABLE `danhgia` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `giaidoan` -- ALTER TABLE `giaidoan` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `hinhanh` -- ALTER TABLE `hinhanh` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; -- -- AUTO_INCREMENT for table `kho` -- ALTER TABLE `kho` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `lichsutintuc` -- ALTER TABLE `lichsutintuc` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; -- -- AUTO_INCREMENT for table `linhvuc` -- ALTER TABLE `linhvuc` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `loaisanpham` -- ALTER TABLE `loaisanpham` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `logtintuc` -- ALTER TABLE `logtintuc` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=180; -- -- AUTO_INCREMENT for table `quyen` -- ALTER TABLE `quyen` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=83; -- -- AUTO_INCREMENT for table `sanpham` -- ALTER TABLE `sanpham` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28; -- -- AUTO_INCREMENT for table `so` -- ALTER TABLE `so` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `taikhoan_vaitro` -- ALTER TABLE `taikhoan_vaitro` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33; -- -- AUTO_INCREMENT for table `thongtin` -- ALTER TABLE `thongtin` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31; -- -- AUTO_INCREMENT for table `thongtingiaidoan` -- ALTER TABLE `thongtingiaidoan` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `tintuc` -- ALTER TABLE `tintuc` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=48; -- -- AUTO_INCREMENT for table `vaitro` -- ALTER TABLE `vaitro` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `vaitro_quyen` -- ALTER TABLE `vaitro_quyen` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=137; -- -- AUTO_INCREMENT for table `video` -- ALTER TABLE `video` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29; COMMIT; /*!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 */;
CREATE OR REPLACE FUNCTION ldo.fn_despesa_projetada_configuracao( integer, character) RETURNS SETOF record LANGUAGE plpgsql AS $BODY$ DECLARE inCodPPA ALIAS FOR $1; stExercicio ALIAS FOR $2; stExercicioInicial VARCHAR; stSql VARCHAR; stSqlAux VARCHAR; reRecord RECORD; flValor_1 NUMERIC(14,2) := 0; flValor_2 NUMERIC(14,2) := 0; flValor_3 NUMERIC(14,2) := 0; flValor_4 NUMERIC(14,2) := 0; boOrcamento_1 NUMERIC(1) := 0; boOrcamento_2 NUMERIC(1) := 0; boOrcamento_3 NUMERIC(1) := 0; boOrcamento_4 NUMERIC(1) := 0; BEGIN stExercicioInicial := TRIM(TO_CHAR((TO_NUMBER(stExercicio,'9999') - 4),'9999')); ----------------------------------------- -- cria a tabela temporaria de retorno -- ----------------------------------------- CREATE TEMPORARY TABLE tmp_retorno ( cod_tipo INTEGER, exercicio VARCHAR(4), cod_estrutural VARCHAR, descricao VARCHAR, tipo CHAR(1), nivel NUMERIC(1), rpps NUMERIC(1), orcamento_1 NUMERIC(1), orcamento_2 NUMERIC(1), orcamento_3 NUMERIC(1), orcamento_4 NUMERIC(1), valor_1 NUMERIC(14,2), valor_2 NUMERIC(14,2), valor_3 NUMERIC(14,2), valor_4 NUMERIC(14,2) ); -------------------------------------------------------- -- recupera os tipos de despesas que vao no relatorio -- -------------------------------------------------------- stSql := 'SELECT * , publico.fn_mascarareduzida(cod_estrutural) AS estrutural_reduzido FROM ldo.tipo_receita_despesa WHERE tipo = ''D'' AND nivel = 1 ORDER BY cod_tipo '; FOR reRecord IN EXECUTE stSql LOOP SELECT SUM(vl_projetado) INTO flValor_1 FROM ldo.configuracao_receita_despesa WHERE configuracao_receita_despesa.cod_ppa = inCodPPA AND configuracao_receita_despesa.cod_tipo = reRecord.cod_tipo AND configuracao_receita_despesa.tipo = reRecord.tipo AND configuracao_receita_despesa.exercicio = TO_NUMBER(stExercicio,'9999')::varchar; SELECT SUM(vl_projetado) INTO flValor_2 FROM ldo.configuracao_receita_despesa WHERE configuracao_receita_despesa.cod_ppa = inCodPPA AND configuracao_receita_despesa.cod_tipo = reRecord.cod_tipo AND configuracao_receita_despesa.tipo = reRecord.tipo AND configuracao_receita_despesa.exercicio = (TO_NUMBER(stExercicio,'9999') + 1)::varchar; SELECT SUM(vl_projetado) INTO flValor_3 FROM ldo.configuracao_receita_despesa WHERE configuracao_receita_despesa.cod_ppa = inCodPPA AND configuracao_receita_despesa.cod_tipo = reRecord.cod_tipo AND configuracao_receita_despesa.tipo = reRecord.tipo AND configuracao_receita_despesa.exercicio = (TO_NUMBER(stExercicio,'9999') + 2)::varchar; SELECT SUM(vl_projetado) INTO flValor_4 FROM ldo.configuracao_receita_despesa WHERE configuracao_receita_despesa.cod_ppa = inCodPPA AND configuracao_receita_despesa.cod_tipo = reRecord.cod_tipo AND configuracao_receita_despesa.tipo = reRecord.tipo AND configuracao_receita_despesa.exercicio = (TO_NUMBER(stExercicio,'9999') + 3)::varchar; ------------------------------------------------------------------------------------- -- insere na tabela de retorno o somatorio do valor dos estruturais para os 4 anos -- ------------------------------------------------------------------------------------- INSERT INTO tmp_retorno VALUES( reRecord.cod_tipo ,stExercicio ,reRecord.cod_estrutural ,reRecord.descricao ,reRecord.tipo ,reRecord.nivel ,CASE WHEN (reRecord.rpps IS TRUE) THEN 1 ELSE 0 END ,boOrcamento_1 ,boOrcamento_2 ,boOrcamento_3 ,boOrcamento_4 ,flValor_1 ,flValor_2 ,flValor_3 ,flValor_4); END LOOP; ---------------------------------------------------------- -- insere na tabela de retorno o somatorio dos niveis 0 -- ---------------------------------------------------------- stSql := ' SELECT publico.fn_mascarareduzida(cod_estrutural) AS estrutural_reduzido , * FROM ldo.tipo_receita_despesa WHERE nivel = 0 AND tipo = ''D'' ORDER BY cod_tipo'; FOR reRecord IN EXECUTE stSql LOOP SELECT SUM(COALESCE(valor_1,0)) INTO flValor_1 FROM tmp_retorno WHERE cod_estrutural LIKE reRecord.estrutural_reduzido || '%' AND nivel = 1; SELECT SUM(COALESCE(valor_2,0)) INTO flValor_2 FROM tmp_retorno WHERE cod_estrutural LIKE reRecord.estrutural_reduzido || '%' AND nivel = 1; SELECT SUM(COALESCE(valor_3,0)) INTO flValor_3 FROM tmp_retorno WHERE cod_estrutural LIKE reRecord.estrutural_reduzido || '%' AND nivel = 1; SELECT SUM(COALESCE(valor_4,0)) INTO flValor_4 FROM tmp_retorno WHERE cod_estrutural LIKE reRecord.estrutural_reduzido || '%' AND nivel = 1; INSERT INTO tmp_retorno ( SELECT reRecord.cod_tipo , stExercicio , reRecord.cod_estrutural , reRecord.descricao , reRecord.tipo , reRecord.nivel , CASE WHEN (reRecord.rpps IS TRUE) THEN 1 ELSE 0 END , boOrcamento_1 , boOrcamento_2 , boOrcamento_3 , boOrcamento_4 , flValor_1 , flValor_2 , flValor_3 , flValor_4); END LOOP; ------------------------ -- retorna os valores -- ------------------------ stSql := ' SELECT cod_tipo , exercicio , cod_estrutural , descricao , tipo , nivel , rpps , orcamento_1 , orcamento_2 , orcamento_3 , orcamento_4 , COALESCE(valor_1,0) , COALESCE(valor_2,0) , COALESCE(valor_3,0) , COALESCE(valor_4,0) FROM tmp_retorno ORDER BY cod_tipo'; FOR reRecord IN EXECUTE stSql LOOP RETURN NEXT reRecord; END LOOP; DROP TABLE tmp_retorno; END; $BODY$
<gh_stars>0 CREATE TABLE FRAIS_VOYAGE (ID bigint not null, MONTANT NUMERIC(10, 2) not null, DATE_DEBUT_VALIDITE date not null, DATE_FIN_VALIDITE date, primary key (id)); ALTER TABLE Sejour ADD COLUMN FRAIS_VOYAGE NUMERIC(10, 2); UPDATE Sejour SET FRAIS_VOYAGE = 0 WHERE FRAIS_VOYAGE IS NULL;
<gh_stars>0 -- sc: https://ru.hexlet.io/courses/rdb-basics/lessons/transactions/exercise_unit -- Механизм дружбы в социальных сетях, обычно, реализуется через отдельную таблицу -- friendship ссылающуюся на обоих пользователей. Когда два человека начинают -- дружить, то в эту таблицу заносятся сразу две записи: -- friendship -- id user1_id user2_id -- 1 3 10 -- 2 10 3 -- Такой способ организации данных позволяет работать с понятием "дружба" -- независимо от того, кто был указан первым, а кто вторым. -- solution.sql -- Составьте транзакцию, которая создает дружбу между пользователями Tirion и Jon. -- Подсказки -- Используйте в решении конкретные идентификаторы пользователей (без выполнения -- подзапросов) -- Идентификаторы пользователей можно узнать, сделав соответствующий запрос в базу -- данных к таблице users, используя psql в терминале упражнения -- CREATE TABLE users ( -- id bigint PRIMARY KEY, -- first_name varchar(255), -- email varchar(255), -- birthday timestamp -- ); -- CREATE TABLE friendship ( -- id bigint PRIMARY KEY GENERATED ALWAYS AS IDENTITY, -- user1_id bigint REFERENCES users(id), -- user2_id bigint REFERENCES users(id) -- ); BEGIN; INSERT INTO friendship (user1_id, user2_id) VALUES (2, 7); INSERT INTO friendship (user1_id, user2_id) VALUES (7, 2); COMMIT; -- один из вариантов, с автовыборкой id пользователя по имени, из ревью другого ученика -- BEGIN; -- INSERT INTO friendship (user1_id, user2_id) -- VALUES ((SELECT id FROM users WHERE first_name = 'Tirion'), (SELECT id FROM users WHERE first_name = 'Jon')); -- INSERT INTO friendship (user1_id, user2_id) -- VALUES ((SELECT id FROM users WHERE first_name = 'Jon'), (SELECT id FROM users WHERE first_name = 'Tirion')); -- COMMIT;
<filename>SQL/Basic Select/Weather Observation Station 11.sql /* Enter your query here. */ SELECT DISTINCT CITY FROM STATION WHERE CITY NOT REGEXP '^[AEIOU]' OR CITY NOT REGEXP '[AEIOU]$';
-- This should only be run once, right after running createBrewDB. -- Equipment Table INSERT INTO equipment(batch_size, extract_efficeny) VALUES(5,0.70); -- default values, 5 gallon batch with 70% efficiency -- Hops Table INSERT INTO hops(name, description, alpha_acid, purpose) VALUES('Cascade 5.5AA', null, 5.5,'aroma'), ('Citra 11AA', null, 11,'dual'), ('Centennial 9AA', null, 9,'dual'), ('Horizon 13AA', null, 13,'bitter'), ('Amarillo 9AA', null, 9,'dual'), ('Simcoe 12AA', null, 12,'bitter'); -- Grain Table INSERT INTO grain(name, region, potential_extract, lovibonds) VALUES('<NAME>', null, 35, 4), ('White Wheat Malt', null, 37, 2), ('Victory Malt', null, 34, 25), ('Dextrin (carapils)', null, 33, 1), ('Black Barley', null, 25, 525), ('Crystal Malt 10', null, 34, 10), ('Crystal Malt 20', null, 34, 20), ('Crystal Malt 30', null, 34, 30), ('Crystal Malt 40', null, 34, 40), ('Crystal Malt 50', null, 34, 50), ('Crystal Malt 60', null, 34, 60), ('Crystal Malt 70', null, 34, 70), ('Crystal Malt 80', null, 34, 80), ('Crystal Malt 90', null, 34, 90), ('Crystal Malt 120', null, 34, 120), ('Melanoidin', 'German', 37, 25), ('2-row Pale Malt', null, 37, 1), ('6-row Pale Malt', null, 35, 1), ('Special Roast', null, 35, 50), ('Wheat Malt', null, 38, 2), ('Chocolate Malt', null, 34, 350), ('RoastedBarley', null, 25, 300), ('Munich Malt', null, 34, 10), ('Munich Malt Light', null, 37, 6), ('Black Patent Malt', null, 26, 500); -- Yeast Table INSERT INTO yeast(name, region, apparent_attenuation, yeast_type) VALUES('WLP001 California Ale', 'American', 0.75, 'ale'), ('WLP002 English Ale Yeast', 'English', 0.68, 'ale'), ('WLP004 Irish Ale Yeast', 'Irish', 0.72, 'ale'), ('WLP005 British Ale Yeast', 'English', 0.71, 'ale'), ('WLP008 East Coast Ale Yeast', 'English', 0.72, 'ale'), ('WLP009 Australian Ale Yeast', 'Australian', 0.71, 'ale'), ('WLP011 European Ale Yeast', 'European', 0.68, 'ale'), ('WLP028 Edinburgh Scottish Ale Yeast', 'Scottish', 0.72, 'ale'), ('WLP029 German/Kölsch Ale Yeast', 'German', 0.76, 'ale'), ('WLP036 Düsseldorf Alt Ale Yeast', 'German', 0.69, 'ale'), ('WLP080 Cream Ale Yeast Blend', 'American', 0.78, 'ale'), ('WLP085 English Ale Yeast Blend', 'English', 0.71, 'ale'), ('WLP800 Pilsner Lager Yeast', 'European', 0.73, 'lager'), ('WLP810 San Francisco Lager Yeast', 'American', 0.68, 'lager'), ('WLP820 Oktoberfest/Märzen Lager Yeast', 'German', 0.70, 'lager'), ('WLP830 German Lager Yeast', 'German', 0.77, 'lager'), ('WLP840 American Lager Yeast', 'American', 0.78, 'lager'), ('WLP940 Mexican Lager Yeast', 'Mexican', 0.74, 'lager'), ('WLP300 Hefeweizen Ale Yeast', 'German', 0.74, 'ale'), ('WLP320 American Hefeweizen Ale Yeast', 'American', 0.73, 'ale'), ('WLP400 Belgian Wit Ale Yeast', 'Belgian', 0.76, 'ale'), ('WLP545 Belgian Strong Ale Yeast', 'Belgian', 0.81, 'ale'), ('WLP568 Belgian-Style Saison Ale Yeast Blend', 'Belgian', 0.75, 'ale'), ('WLP570 Belgian Golden Ale Yeast', 'Belgian', 0.76, 'ale'), ('WLP630 Berliner Weisse Blend', 'Berlin', 0.77, 'other'), ('WLP665 Flemish Ale Blend', 'Belgian', 0.71, 'ale'), ('WLP670 American Farmhouse Blend', 'American', 0.79, 'ale'); -- Additive Table INSERT INTO additive(name, description, use_case) VALUES('Whirloc', null, 'fining'), ('Irish Moss', null, 'fining'); -- Beer Style Table INSERT INTO beer_style(name, min_bitterness, max_bitterness, min_color, max_color, min_ABV, max_ABV) VALUES('American Imperial Porter', 35, 50, 39, 40, 7, 12), ('Hefeweizen', 10, 15, 3, 9, 4.9, 5.6), ('American Brown Ale', 25, 45, 5, 26, 4, 6.4), ('Belgian Saison', 20, 38, 5, 7, 4.4,6.8), ('American Lager', 5, 15, 2, 6, 3.2, 4), ('Kolsch', 18, 28, 3, 6, 4.8, 5.3), ('American IPA', 50, 70, 6, 12, 6.3, 7.5), ('American Stout', 35, 60, 39, 40, 5.7, 8.9), ('American Imperial IPA', 65, 100, 5, 15, 7.5, 10.5), ('American Pale Ale', 20, 50, 3, 14, 4.2, 6.2); -- Beer Recipes constructed below -- Build recipe for Hoppiness is an IPA American IPA INSERT INTO beer_recipe(name, boil_time, description, instructions) VALUES('Hoppiness is an IPA', 60, 'For those in the “pursuit of hoppiness,” you won’t want to miss this one! With a nice variety of hops, this beer from Brewing Classic Styles by <NAME> and <NAME>, is perfect for those who can’t get enough of hops.','https://www.homebrewersassociation.org/homebrew-recipe/beer-recipe-of-the-week-hoppiness-is-an-ipa/'); -- grabs last auto_increment id used SET @recipe = (SELECT beer_recipe.id FROM beer_recipe WHERE beer_recipe.id=LAST_INSERT_ID()); -- Add 12.75lbs of 2-row pale malt SET @grain = (SELECT grain.id FROM grain WHERE name='2-row Pale Malt'); INSERT INTO grain_in_recipe(grain_id, recipe_id, amount) VALUES(@grain,@recipe, 12.75); -- Add 2 lbs of munich malt SET @grain = (SELECT grain.id FROM grain WHERE name='Munich Malt'); INSERT INTO grain_in_recipe(grain_id, recipe_id, amount) VALUES(@grain,@recipe, 2); -- Add 1 oz of horizon hops SET @hops = (SELECT hops.id FROM hops WHERE name='Horizon 13AA'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 1, 60); -- Add 1 oz of centennial hops SET @hops = (SELECT hops.id FROM hops WHERE name='Centennial 9AA'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 1, 10); -- Add 1 oz of simcoe hops SET @hops = (SELECT hops.id FROM hops WHERE name='Simcoe 12AA'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 1, 5); -- Add 1 oz of amarillo hops SET @hops = (SELECT hops.id FROM hops WHERE name='Amarillo 9AA'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 1, 0); -- Add california ale yeast SET @yeast = (SELECT yeast.id FROM yeast WHERE name='WLP001 California Ale'); INSERT INTO yeast_in_recipe(yeast_id, recipe_id) VALUES(@yeast,@recipe); -- Add american ipa style SET @style = (SELECT beer_style.id FROM beer_style WHERE name='American IPA'); INSERT INTO style_of_recipe(style_id, recipe_id) VALUES(@style,@recipe); -- Build recipe for Classic American Pale Ale INSERT INTO beer_recipe(name, boil_time) VALUES('Classic American Pale Ale', 60); -- grabs last auto_increment id used SET @recipe = (SELECT beer_recipe.id FROM beer_recipe WHERE beer_recipe.id=LAST_INSERT_ID()); -- Add 11lbs of 2-row pale malt SET @grain = (SELECT grain.id FROM grain WHERE name='2-row Pale Malt'); INSERT INTO grain_in_recipe(grain_id, recipe_id, amount) VALUES(@grain,@recipe, 11); -- Add 0.5 lbs of crystal malt 40 SET @grain = (SELECT grain.id FROM grain WHERE name='Crystal Malt 40'); INSERT INTO grain_in_recipe(grain_id, recipe_id, amount) VALUES(@grain,@recipe, 0.5); -- Add 2 oz of amarillo hops SET @hops = (SELECT hops.id FROM hops WHERE name='Cascade 5.5AA'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 2, 60); -- Add 2 oz of amarillo hops SET @hops = (SELECT hops.id FROM hops WHERE name='Cascade 5.5AA'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 2, 10); -- Add california ale yeast SET @yeast = (SELECT yeast.id FROM yeast WHERE name='WLP001 California Ale'); INSERT INTO yeast_in_recipe(yeast_id, recipe_id) VALUES(@yeast,@recipe); -- Add american pale ale style SET @style = (SELECT beer_style.id FROM beer_style WHERE name='American Pale Ale'); INSERT INTO style_of_recipe(style_id, recipe_id) VALUES(@style,@recipe); -- Build recipe for Zombie Dust Clone INSERT INTO beer_recipe(name, boil_time, description, instructions) VALUES('Zombie Dust Clone Pale Ale', 60, null, 'https://www.brewersfriend.com/homebrew/recipe/view/280731/zombie-dust-clone-brain-eater'); -- grabs last auto_increment id used SET @recipe = (SELECT beer_recipe.id FROM beer_recipe WHERE beer_recipe.id=LAST_INSERT_ID()); -- Add 11lbs of 2-row pale malt SET @grain = (SELECT grain.id FROM grain WHERE name='2-row Pale Malt'); INSERT INTO grain_in_recipe(grain_id, recipe_id, amount) VALUES(@grain,@recipe, 12); -- Add 0.5 lbs of munich malt light SET @grain = (SELECT grain.id FROM grain WHERE name='Munich Malt Light'); INSERT INTO grain_in_recipe(grain_id, recipe_id, amount) VALUES(@grain,@recipe, 1.5); -- Add 0.5 lbs of Melanoidin SET @grain = (SELECT grain.id FROM grain WHERE name='Melanoidin'); INSERT INTO grain_in_recipe(grain_id, recipe_id, amount) VALUES(@grain,@recipe, 0.5); -- Add 0.5 lbs of carapils SET @grain = (SELECT grain.id FROM grain WHERE name LIKE '%Carapils%'); INSERT INTO grain_in_recipe(grain_id, recipe_id, amount) VALUES(@grain,@recipe, 0.5); -- Add 0.5 lbs of crystal malt 60 SET @grain = (SELECT grain.id FROM grain WHERE name='Crystal Malt 60'); INSERT INTO grain_in_recipe(grain_id, recipe_id, amount) VALUES(@grain,@recipe, 0.5); -- Add 0.5 oz of citra hops SET @hops = (SELECT hops.id FROM hops WHERE name LIKE '%Citra%'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 0.5, 60); -- Add 1 oz of citra hops SET @hops = (SELECT hops.id FROM hops WHERE name LIKE '%Citra%'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 1, 15); -- Add 1 oz of citra hops SET @hops = (SELECT hops.id FROM hops WHERE name LIKE '%Citra%'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 1, 10); -- Add 1 oz of citra hops SET @hops = (SELECT hops.id FROM hops WHERE name LIKE '%Citra%'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 1, 5); -- Add 1 oz of citra hops SET @hops = (SELECT hops.id FROM hops WHERE name LIKE '%Citra%'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 1, 0); -- Add 3 oz of citra hops SET @hops = (SELECT hops.id FROM hops WHERE name LIKE '%Citra%'); INSERT INTO hops_in_recipe(hops_id, recipe_id, amount, exposure_time) VALUES(@hops,@recipe, 3, -7); -- Add california ale yeast SET @yeast = (SELECT yeast.id FROM yeast WHERE name='WLP001 California Ale'); INSERT INTO yeast_in_recipe(yeast_id, recipe_id) VALUES(@yeast,@recipe); -- Add 3 oz of citra hops SET @additive = (SELECT additive.id FROM additive WHERE name LIKE '%Whirloc%'); INSERT INTO additive_in_recipe(additive_id, recipe_id, amount, exposure_time) VALUES(@additive,@recipe, 1, 20); -- Add american pale ale style SET @style = (SELECT beer_style.id FROM beer_style WHERE name='American Pale Ale'); INSERT INTO style_of_recipe(style_id, recipe_id) VALUES(@style,@recipe);
-- Keep a log of any SQL queries you execute as you solve the mystery. -- the theft took place on July 28, 2020 and that it took place on Chamberlin Street. -- looking the crime scene report >> SELECT description FROM crime_scene_reports WHERE month = 7 AND day = 28 AND year = 2020 AND street = 'Chamberlin Street'; -- retrived: Theft of the CS50 duck took place at 10:15am at the Chamberlin Street courthouse. --Interviews were conducted today with three witnesses who were present at the time — each of their interview transcripts mentions the courthouse. --checking interviews >> SELECT name, transcript FROM interviews WHERE month = 7 AND day = 28 AND year = 2020; -- retrived: Jose | “Ah,” said he, “I forgot that I had not seen you for some weeks. It is a little souvenir from the King of Bohemia in return for my assistance in the case of the Irene Adler papers.” --Eugene | “I suppose,” said Holmes, “that when Mr. Windibank came back from France he was very annoyed at your having gone to the ball.” --Barbara | “You had my note?” he asked with a deep harsh voice and a strongly marked German accent. “I told you that I would call.” He looked from one to the other of us, as if uncertain which to address. --Ruth | Sometime within ten minutes of the theft, I saw the thief get into a car in the courthouse parking lot and drive away. If you have security footage from the courthouse parking lot, you might want to look for cars that left the parking lot in that time frame. --Eugene | I don't know the thief's name, but it was someone I recognized. Earlier this morning, before I arrived at the courthouse, I was walking by the ATM on Fifer Street and saw the thief there withdrawing some money. --Raymond | As the thief was leaving the courthouse, they called someone who talked to them for less than a minute. In the call, I heard the thief say that they were planning to take the earliest flight out of Fiftyville tomorrow. The thief then asked the person on the other end of the phone to purchase the flight ticket. -- looking security log >> SELECT id, activity, license_plate FROM courthouse_security_logs WHERE month = 7 AND day = 28 AND year = 2020 AND hour = 10 AND minute >= 15 AND minute < 30; --260 | exit | 5P2BI95 --261 | exit | 94KL13X --262 | exit | 6P58WS2 --263 | exit | 4328GD8 --264 | exit | G412CB7 --265 | exit | L93JTIZ --266 | exit | 322W7JE --267 | exit | 0NTHK55 --looking ATM transactions >> SELECT id, account_number, transaction_type, amount FROM atm_transactions WHERE month = 7 AND day = 28 AND year = 2020 AND atm_location = 'Fifer Street'; -- retrived: --246 | 28500762 | withdraw | 48 --264 | 28296815 | withdraw | 20 --266 | 76054385 | withdraw | 60 --267 | 49610011 | withdraw | 50 --269 | 16153065 | withdraw | 80 --275 | 86363979 | deposit | 10 --288 | 25506511 | withdraw | 20 --313 | 81061156 | withdraw | 30 --336 | 26013199 | withdraw | 35 SELECT id, caller, receiver FROM phone_calls WHERE month = 7 AND day = 28 AND year = 2020 AND duration < 60; --retrived: --id | caller | receiver --221 | (130) 555-0289 | (996) 555-8899 --224 | (499) 555-9472 | (892) 555-8872 --233 | (367) 555-5533 | (375) 555-8161 --251 | (499) 555-9472 | (717) 555-1342 --254 | (286) 555-6063 | (676) 555-6554 --255 | (770) 555-1861 | (725) 555-3243 --261 | (031) 555-6622 | (910) 555-3251 --279 | (826) 555-1652 | (066) 555-9701 --281 | (338) 555-6650 | (704) 555-2131 SELECT * FROM people WHERE phone_number = '(130) 555-0289'; --398010 | Roger | (130) 555-0289 | 1695452385 | G412CB7 SELECT * FROM people WHERE phone_number = '(499) 555-9472'; --560886 | Evelyn | (499) 555-9472 | 8294398571 | 0NTHK55 SELECT * FROM people WHERE phone_number = '(367) 555-5533'; --686048 | Ernest | (367) 555-5533 | 5773159633 | 94KL13X SELECT * FROM people WHERE phone_number = '(286) 555-6063'; --449774 | Madison | (286) 555-6063 | 1988161715 | 1106N58 SELECT * FROM people WHERE phone_number = '(770) 555-1861'; --514354 | Russell | (770) 555-1861 | 3592750733 | 322W7JE SELECT * FROM people WHERE phone_number = '(031) 555-6622'; --907148 | Kimberly | (031) 555-6622 | 9628244268 | Q12B3Z3 SELECT * FROM people WHERE phone_number = '(826) 555-1652'; --395717 | Bobby | (826) 555-1652 | 9878712108 | 30G67EN SELECT * FROM people WHERE phone_number = '(338) 555-6650'; --438727 | Victoria | (338) 555-6650 | 9586786673 | 8X428L0 --260 | exit | 5P2BI95 --261 | exit | 94KL13X Ernest --prime --262 | exit | 6P58WS2 --263 | exit | 4328GD8 --264 | exit | G412CB7 Roger --SHORT LIST --265 | exit | L93JTIZ --266 | exit | 322W7JE Russell --prime --267 | exit | 0NTHK55 Evelyn SELECT * FROM bank_accounts JOIN people ON bank_accounts.person_id = people.id WHERE account_number = 28500762 OR account_number = 28296815 OR account_number = 76054385 OR account_number = 49610011 OR account_number = 16153065 OR account_number = 25506511 OR account_number = 81061156 OR account_number = 26013199; --retrived >> account_number | person_id | creation_year | id | name | phone_number | passport_number | license_plate --49610011 | 686048 | 2010 | 686048 | Ernest | (367) 555-5533 | 5773159633 | 94KL13X --prime --26013199 | 514354 | 2012 | 514354 | Russell | (770) 555-1861 | 3592750733 | 322W7JE --prime --16153065 | 458378 | 2012 | 458378 | Roy | (122) 555-4581 | 4408372428 | QX4YZN3 --28296815 | 395717 | 2014 | 395717 | Bobby | (826) 555-1652 | 9878712108 | 30G67EN --25506511 | 396669 | 2014 | 396669 | Elizabeth | (829) 555-5269 | 7049073643 | L93JTIZ --28500762 | 467400 | 2014 | 467400 | Danielle | (389) 555-5198 | 8496433585 | 4328GD8 --76054385 | 449774 | 2015 | 449774 | Madison | (286) 555-6063 | 1988161715 | 1106N58 --81061156 | 438727 | 2018 | 438727 | Victoria | (338) 555-6650 | 9586786673 | 8X428L0 SELECT * FROM people WHERE phone_number = '(725) 555-3243'; --847116 | Philip | (725) 555-3243 | 3391710505 | GW362R6 SELECT * FROM people WHERE phone_number = '(375) 555-8161'; --864400 | Berthold | (375) 555-8161 | | 4V16VO0 SELECT * FROM flights JOIN passengers ON flights.id = passengers.flight_id JOIN airports ON flights.origin_airport_id = airports.id WHERE month = 7 AND day = 29 AND year = 2020 ORDER BY hour DESC; --id | origin_airport_id | destination_airport_id | year | month | day | hour | minute | flight_id | passport_number | seat | id | abbreviation | full_name | city --18 | 8 | 6 | 2020 | 7 | 29 | 16 | 0 | 18 | 2835165196 | 9C | 8 | CSF | Fiftyville Regional Airport | Fiftyville --18 | 8 | 6 | 2020 | 7 | 29 | 16 | 0 | 18 | 6131360461 | 2C | 8 | CSF | Fiftyville Regional Airport | Fiftyville --18 | 8 | 6 | 2020 | 7 | 29 | 16 | 0 | 18 | 3231999695 | 3C | 8 | CSF | Fiftyville Regional Airport | Fiftyville --18 | 8 | 6 | 2020 | 7 | 29 | 16 | 0 | 18 | 3592750733 | 4C | 8 | CSF | Fiftyville Regional Airport | Fiftyville 3592750733 --18 | 8 | 6 | 2020 | 7 | 29 | 16 | 0 | 18 | 2626335085 | 5D | 8 | CSF | Fiftyville Regional Airport | Fiftyville --18 | 8 | 6 | 2020 | 7 | 29 | 16 | 0 | 18 | 6117294637 | 6B | 8 | CSF | Fiftyville Regional Airport | Fiftyville --18 | 8 | 6 | 2020 | 7 | 29 | 16 | 0 | 18 | 2996517496 | 7A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --18 | 8 | 6 | 2020 | 7 | 29 | 16 | 0 | 18 | 3915621712 | 8D | 8 | CSF | Fiftyville Regional Airport | Fiftyville --53 | 8 | 9 | 2020 | 7 | 29 | 15 | 20 | 53 | 7894166154 | 9B | 8 | CSF | Fiftyville Regional Airport | Fiftyville --53 | 8 | 9 | 2020 | 7 | 29 | 15 | 20 | 53 | 6034823042 | 2C | 8 | CSF | Fiftyville Regional Airport | Fiftyville --53 | 8 | 9 | 2020 | 7 | 29 | 15 | 20 | 53 | 4408372428 | 3D | 8 | CSF | Fiftyville Regional Airport | Fiftyville --53 | 8 | 9 | 2020 | 7 | 29 | 15 | 20 | 53 | 2312901747 | 4D | 8 | CSF | Fiftyville Regional Airport | Fiftyville --53 | 8 | 9 | 2020 | 7 | 29 | 15 | 20 | 53 | 1151340634 | 5A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --53 | 8 | 9 | 2020 | 7 | 29 | 15 | 20 | 53 | 8174538026 | 6D | 8 | CSF | Fiftyville Regional Airport | Fiftyville --53 | 8 | 9 | 2020 | 7 | 29 | 15 | 20 | 53 | 1050247273 | 7A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --53 | 8 | 9 | 2020 | 7 | 29 | 15 | 20 | 53 | 7834357192 | 8C | 8 | CSF | Fiftyville Regional Airport | Fiftyville --23 | 8 | 11 | 2020 | 7 | 29 | 12 | 15 | 23 | 4149859587 | 7D | 8 | CSF | Fiftyville Regional Airport | Fiftyville --23 | 8 | 11 | 2020 | 7 | 29 | 12 | 15 | 23 | 9183348466 | 8A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --23 | 8 | 11 | 2020 | 7 | 29 | 12 | 15 | 23 | 7378796210 | 9B | 8 | CSF | Fiftyville Regional Airport | Fiftyville --23 | 8 | 11 | 2020 | 7 | 29 | 12 | 15 | 23 | 7874488539 | 2C | 8 | CSF | Fiftyville Regional Airport | Fiftyville --23 | 8 | 11 | 2020 | 7 | 29 | 12 | 15 | 23 | 4195341387 | 3A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --23 | 8 | 11 | 2020 | 7 | 29 | 12 | 15 | 23 | 6263461050 | 4A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --23 | 8 | 11 | 2020 | 7 | 29 | 12 | 15 | 23 | 3231999695 | 5A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --23 | 8 | 11 | 2020 | 7 | 29 | 12 | 15 | 23 | 7951366683 | 6B | 8 | CSF | Fiftyville Regional Airport | Fiftyville --43 | 8 | 1 | 2020 | 7 | 29 | 9 | 30 | 43 | 7597790505 | 7B | 8 | CSF | Fiftyville Regional Airport | Fiftyville --43 | 8 | 1 | 2020 | 7 | 29 | 9 | 30 | 43 | 6128131458 | 8A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --43 | 8 | 1 | 2020 | 7 | 29 | 9 | 30 | 43 | 6264773605 | 9A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --43 | 8 | 1 | 2020 | 7 | 29 | 9 | 30 | 43 | 3642612721 | 2C | 8 | CSF | Fiftyville Regional Airport | Fiftyville --43 | 8 | 1 | 2020 | 7 | 29 | 9 | 30 | 43 | 4356447308 | 3B | 8 | CSF | Fiftyville Regional Airport | Fiftyville --43 | 8 | 1 | 2020 | 7 | 29 | 9 | 30 | 43 | 7441135547 | 4A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --36 | 8 | 4 | 2020 | 7 | 29 | 8 | 20 | 36 | 7214083635 | 2A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --36 | 8 | 4 | 2020 | 7 | 29 | 8 | 20 | 36 | 1695452385 | 3B | 8 | CSF | Fiftyville Regional Airport | Fiftyville --36 | 8 | 4 | 2020 | 7 | 29 | 8 | 20 | 36 | 5773159633 | 4A | 8 | CSF | Fiftyville Regional Airport | Fiftyville 5773159633 --36 | 8 | 4 | 2020 | 7 | 29 | 8 | 20 | 36 | 1540955065 | 5C | 8 | CSF | Fiftyville Regional Airport | Fiftyville --36 | 8 | 4 | 2020 | 7 | 29 | 8 | 20 | 36 | 8294398571 | 6C | 8 | CSF | Fiftyville Regional Airport | Fiftyville --36 | 8 | 4 | 2020 | 7 | 29 | 8 | 20 | 36 | 1988161715 | 6D | 8 | CSF | Fiftyville Regional Airport | Fiftyville --36 | 8 | 4 | 2020 | 7 | 29 | 8 | 20 | 36 | 9878712108 | 7A | 8 | CSF | Fiftyville Regional Airport | Fiftyville --36 | 8 | 4 | 2020 | 7 | 29 | 8 | 20 | 36 | 8496433585 | 7B | 8 | CSF | Fiftyville Regional Airport | Fiftyville SELECT * FROM airports WHERE id = 4 OR id = 6; --4 | LHR | Heathrow Airport | London --prime --6 | BOS | Logan International Airport | Boston
CREATE DATABASE IF NOT EXISTS `users_manager_db` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `users_manager_db`; -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64) -- -- Host: localhost Database: users_manager_db -- ------------------------------------------------------ -- Server version 5.6.11 /*!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 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `addresses` -- DROP TABLE IF EXISTS `addresses`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `addresses` ( `id` int(11) NOT NULL AUTO_INCREMENT, `city` varchar(45) NOT NULL, `street` varchar(45) NOT NULL, `id_user` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `fk_users_idx` (`id_user`), CONSTRAINT `fk_users` FOREIGN KEY (`id_user`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!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 */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2017-10-31 20:59:24
/* Patient Resource */ SELECT nhsNumber, nhsNumberTraceStatusDesc, nhsNumberTraceStatusCode, patient.patientNo, identifiers.secondaryIdentifiers, active, ethnicCategoryCode, ethnicCategoryDesc, ethnic.CareConnect_Code AS ethnicCategoryCareConnectCode, ethnic.CareConnect_Display AS ethnicCategoryCareConnectDesc, UPPER(religiousAffiliationCode) AS religiousAffiliationCode, religiousAffiliationDesc, homePhone, businessPhone, mobilePhone, appointmentSMS, email, preferredContactMethod, preferredLanguageCode, preferredLanguageDesc, interpreterRequired, nameFamily, nameGiven1First, nameGiven2Middle, namePrefix, maritalStatusDesc, maritalStatusCode, addressLine1, addressLine2, city, district, postalCode, gender, birthDate, CONCAT(COALESCE(deceasedDate, ''), 'T', COALESCE(deceasedTime, '')) AS deceasedDateTime, gpDesc, gpAddressLine1, gpAddressLine2, gpCity, gpPostalCode, gpIdentifier, contactName, contactPhone, contactText, dnd.DND, school.schoolName, school.schoolId, school.schoolPhone, -- Every resource query must always have a lastUpdated column CONCAT(COALESCE(lastUpdateDate, ''), 'T', COALESCE(lastUpdateTime, '')) AS lastUpdated FROM OPENQUERY( [ENYH-PRD-ANALYTICS], 'SELECT patmas.PAPMI_PAPER_DR->PAPER_ID AS nhsNumber, patmas.PAPMI_TraceStatus_DR->TRACE_Desc AS nhsNumberTraceStatusDesc, patmas.PAPMI_TraceStatus_DR AS nhsNumberTraceStatusCode, patmas.PAPMI_No AS patientNo, -- MRN patmas.PAPMI_Active, CASE WHEN patmas.PAPMI_Active IS NULL THEN ''true'' WHEN patmas.PAPMI_Active = ''Y'' THEN ''true'' ELSE NULL END AS active, -- ethnicCategory patmas.PAPMI_PAPER_DR->PAPER_IndigStat_DR->INDST_Desc AS ethnicCategoryDesc, patmas.PAPMI_PAPER_DR->PAPER_IndigStat_DR->INDST_Code AS ethnicCategoryCode, --religiousAffiliation patmas.PAPMI_PAPER_DR->PAPER_Religion_DR->CTRLG_Desc AS religiousAffiliationDesc, patmas.PAPMI_PAPER_DR->PAPER_Religion_DR->CTRLG_Code AS religiousAffiliationCode, -- nhsCommunication/Telecoms patmas.PAPMI_PAPER_DR->PAPER_TelH AS homePhone, patmas.PAPMI_PAPER_DR->PAPER_TelO AS businessPhone, patmas.PAPMI_PAPER_DR->PAPER_MobPhone AS mobilePhone, patmas.PAPMI_PAPER_DR->PAPER_AppointmentSMS AS appointmentSMS, patmas.PAPMI_PAPER_DR->PAPER_Email AS Email, patmas.PAPMI_PAPER_DR->PAPER_PreferredContactMethod AS preferredContactMethod, patmas.PAPMI_PAPER_DR->PAPER_PrefLanguage_DR->PREFL_Desc AS preferredLanguageDesc, patmas.PAPMI_PAPER_DR->PAPER_PrefLanguage_DR->PREFL_Code AS preferredLanguageCode, patmas.PAPMI_PAPER_DR->PAPER_InterpreterRequired AS interpreterRequired, patmas.PAPMI_PAPER_DR->PAPER_UpdateDate AS lastUpdateDate, patmas.PAPMI_PAPER_DR->PAPER_UpdateTime AS lastUpdateTime, -- name (official) patmas.PAPMI_PAPER_DR->PAPER_Name AS nameFamily, patmas.PAPMI_PAPER_DR->PAPER_Name2 AS nameGiven1First, patmas.PAPMI_PAPER_DR->PAPER_Name3 AS nameGiven2Middle, patmas.PAPMI_PAPER_DR->PAPER_Title_DR->TTL_Desc AS nameprefix, -- contact (NoK) patmas.PAPMI_PAPER_DR->PAPER_NokName AS contactName, patmas.PAPMI_PAPER_DR->PAPER_NokPhone AS contactPhone, patmas.PAPMI_PAPER_DR->PAPER_NokText AS contactText, -- marital status CASE patmas.PAPMI_PAPER_DR->PAPER_Marital_DR->CTMAR_RowId WHEN 1 THEN ''Married'' WHEN 2 THEN ''unknown'' WHEN 3 THEN ''Widowed'' WHEN 4 THEN ''unmarried'' WHEN 5 THEN ''Legally Seperated'' WHEN 6 THEN ''Divorced'' END AS maritalStatusDesc, CASE patmas.PAPMI_PAPER_DR->PAPER_Marital_DR->CTMAR_Code WHEN ''N'' THEN ''U'' ELSE patmas.PAPMI_PAPER_DR->PAPER_Marital_DR->CTMAR_Code END AS maritalStatusCode, -- address (home) patmas.PAPMI_PAPER_DR->PAPER_StName AS addressLine1, patmas.PAPMI_PAPER_DR->PAPER_ForeignAddress AS addressLine2, patmas.PAPMI_PAPER_DR->PAPER_CityCode_DR->CTCIT_Desc AS city, patmas.PAPMI_PAPER_DR->PAPER_CT_Province_DR->PROV_Desc AS district, patmas.PAPMI_PAPER_DR->PAPER_Zip_DR->CTZIP_Code AS postalCode, -- Misc extensions and data CASE patmas.PAPMI_PAPER_DR->PAPER_Sex_DR->CTSEX_RowId WHEN 1 THEN ''female'' WHEN 2 THEN ''unknown'' WHEN 3 THEN ''other'' WHEN 4 THEN ''male'' END AS gender, patmas.PAPMI_DOB AS birthDate, patmas.PAPMI_Deceased_Date as deceasedDate, patmas.PAPMI_DeceasedTime as deceasedTime, -- GP Practice patmas.PAPMI_PAPER_DR->PAPER_FamilyDoctor_DR->REFD_Desc AS gpDesc, patmas.PAPMI_PAPER_DR->PAPER_FamilyDoctorClinic_DR->CLN_Address1 AS gpAddressLine1, patmas.PAPMI_PAPER_DR->PAPER_FamilyDoctorClinic_DR->CLN_Address2 AS gpAddressLine2, patmas.PAPMI_PAPER_DR->PAPER_FamilyDoctorClinic_DR->CLN_City_DR->CTCIT_Desc AS gpCity, patmas.PAPMI_PAPER_DR->PAPER_FamilyDoctorClinic_DR->CLN_Zip_DR->CTZIP_Code AS gpPostalCode, patmas.PAPMI_PAPER_DR->PAPER_FamilyDoctorClinic_DR->CLN_Code AS gpIdentifier FROM PA_PatMas patmas WHERE COALESCE(PAPMI_Active,''Y'') = ''Y'' AND (patmas.PAPMI_PAPER_DR->PAPER_ID IS NOT NULL OR patmas.PAPMI_No IS NOT NULL) AND (patmas.PAPMI_No = ''5484125'')') AS patient LEFT JOIN lookup.dbo.ydh_dnd AS dnd WITH (NOLOCK) ON patient.patientNo = dnd.patientNo LEFT JOIN OPENQUERY([ENYH-PRD-ANALYTICS], 'SELECT DISTINCT NOK_NonGovOrg_DR->NGO_Code AS schoolId, NOK_NonGovOrg_DR->NGO_Desc AS schoolName, NOK_NonGovOrg_DR->NGO_Phone AS schoolPhone, NOK_PAPMI_ParRef->PAPMI_No AS patientNo FROM PA_NOK WHERE NOK_Relation_DR->CTRLT_Code = ''SCH'' AND NOK_Inactive = ''N'' AND NOK_PAPMI_ParRef->PAPMI_No = ''5484125'' ') AS school ON patient.patientNo = school.patientNo LEFT JOIN lookup.dbo.ydh_ethnicity_list ethnic WITH (NOLOCK) ON patient.ethnicCategoryCode = ethnic.YDH_TrakCare_Code LEFT JOIN( SELECT ( SELECT 'secondary' AS "use", CASE code WHEN 'GEN' THEN 'https://fhir.ydh.nhs.uk/Id/medical-record-number' WHEN 'HSP' THEN 'https://fhir.ydh.nhs.uk/Id/legacy-hospital-number' WHEN 'KOR' THEN 'https://fhir.ydh.nhs.uk/Id/korner-number' WHEN 'XRA' THEN 'https://fhir.ydh.nhs.uk/Id/x-ray-number' ELSE NULL END AS [system], [value] FROM OPENQUERY([ENYH-PRD-ANALYTICS], 'SELECT RTMAS_MRType_DR->TYP_Code AS code, RTMAS_MRNo AS value FROM RT_Master WHERE RTMAS_Active = ''Y'' AND RTMAS_MRType_DR->TYP_Code != ''NHS'' AND (RTMAS_PatNo_DR->PAPMI_No = ''5484125'') ') FOR JSON PATH, ROOT('identifier')) AS secondaryIdentifiers) AS identifiers ON 1 = 1
SELECT pypi_tmp.constrain_product_version(); SELECT pypi_tmp.constrain_download_counts();
<gh_stars>1-10 -- -------------------------------------------------------- -- Host: localhost -- Server version: 5.7.24 - MySQL Community Server (GPL) -- Server OS: Win64 -- HeidiSQL Version: 10.2.0.5599 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!50503 SET NAMES utf8mb4 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -- Dumping database structure for student_result CREATE DATABASE IF NOT EXISTS `student_result` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `student_result`; -- Dumping structure for table student_result.results CREATE TABLE IF NOT EXISTS `results` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `student_id` bigint(20) unsigned NOT NULL, `exam_year` smallint(6) NOT NULL, `exam_type` enum('SSC','HSC') COLLATE utf8mb4_unicode_ci NOT NULL, `subject` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, `grade` double(4,2) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `results_student_id_foreign` (`student_id`), CONSTRAINT `results_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table student_result.results: ~6 rows (approximately) /*!40000 ALTER TABLE `results` DISABLE KEYS */; INSERT INTO `results` (`id`, `student_id`, `exam_year`, `exam_type`, `subject`, `grade`, `created_at`, `updated_at`) VALUES (1, 1, 2021, 'SSC', 'Sub1', 5.00, '2021-03-16 21:46:39', NULL), (2, 1, 2021, 'SSC', 'Sub2', 4.00, '2021-03-16 21:47:07', NULL), (3, 1, 2021, 'SSC', 'Sub3', 3.50, '2021-03-16 21:47:50', NULL), (4, 2, 2021, 'SSC', 'Sub1', 4.50, '2021-03-16 21:49:26', NULL), (5, 2, 2021, 'SSC', 'Sub2', 5.00, '2021-03-16 21:51:23', NULL), (6, 2, 2021, 'SSC', 'Sub3', 3.00, '2021-03-16 21:52:12', NULL); /*!40000 ALTER TABLE `results` ENABLE KEYS */; -- Dumping structure for table student_result.students CREATE TABLE IF NOT EXISTS `students` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `regi_number` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table student_result.students: ~2 rows (approximately) /*!40000 ALTER TABLE `students` DISABLE KEYS */; INSERT INTO `students` (`id`, `name`, `regi_number`, `created_at`, `updated_at`) VALUES (1, 'student1', 1001, '2021-03-16 21:45:35', NULL), (2, 'student2', 1002, '2021-03-16 21:45:57', NULL); /*!40000 ALTER TABLE `students` ENABLE KEYS */; /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
<reponame>sedc-codecademy/skwd8-07-dbdevdesign --ALTER TABLE [dbo].[OrderDetails] WITH NOCHECK ADD CONSTRAINT [FK_OrderDetails_Product] FOREIGN KEY ([ProductId]) REFERENCES [dbo].[Product]([Id]); --GO ALTER TABLE [dbo].[OrderDetails] ADD CONSTRAINT [FK_OrderDetails_Product] FOREIGN KEY ([ProductId]) REFERENCES [dbo].[Product]([Id]); GO exec dbo.CreateOrderDetail @OrderId = 4206, @ProductId = 12313122, @Quantity = 5 GO CREATE OR ALTER PROCEDURE dbo.CreateOrderDetail (@OrderId int, @ProductId int, @Quantity int) AS BEGIN declare @Price decimal(18,9) declare @TotalPrice decimal(18,9) -- get the product price select @Price = Price from dbo.Product where id = @ProductId -- insert new order detail BEGIN TRY INSERT INTO dbo.OrderDetails ([OrderId], [ProductId], [Quantity], [Price]) VALUES (@OrderId, @ProductId, @Quantity, @Price) END TRY BEGIN CATCH SELECT ERROR_NUMBER() AS ErrorNumber , ERROR_SEVERITY() AS ErrorSeverity , ERROR_STATE() AS ErrorState , ERROR_PROCEDURE() AS ErrorProcedure , ERROR_LINE() AS ErrorLine , ERROR_MESSAGE() AS ErrorMessage; END CATCH; -- calculate the total price SET @TotalPrice = ( SELECT sum(Quantity * Price) FROM dbo.[OrderDetails] o WHERE o.OrderId = @OrderId ) -- correct the total price update o set TotalPrice = @TotalPrice from [Order] o where id = @OrderId -- output SELECT p.Name, sum(o.Quantity) as TotalQuantity, sum(o.Quantity * o.Price) as TotalPricePerProduct FROM dbo.[OrderDetails] o INNER JOIN dbo.Product p on p.id = o.ProductId WHERE o.OrderId = @OrderId GROUP BY p.Name END GO
<filename>src/test/resources/sql/insert/4cd82d58.sql<gh_stars>10-100 -- file:combocid.sql ln:20 expect:true INSERT INTO combocidtest VALUES (1)
<filename>modules/ide-integration/src/main/resources/database_scripts/init/02-sharing-registry-migrations.sql use sharing_catalog; ALTER TABLE DOMAIN ADD COLUMN IF NOT EXISTS INITIAL_USER_GROUP_ID varchar(255); ALTER TABLE DOMAIN ADD CONSTRAINT `DOMAIN_INITIAL_USER_GROUP_ID_FK` FOREIGN KEY IF NOT EXISTS (INITIAL_USER_GROUP_ID, DOMAIN_ID) REFERENCES USER_GROUP(GROUP_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION;
<reponame>aluhvihn/UniversityProjects DROP TABLE IF EXISTS Bids; DROP TABLE IF EXISTS ItemCategories; DROP TABLE IF EXISTS Items; DROP TABLE IF EXISTS Users;
-- -- Constraints der exportierten Tabellen -- -- -- Constraints der Tabelle `pc_news_archive` -- ALTER TABLE `pc_news_archive` ADD CONSTRAINT `pc_news_archive_ibfk_1` FOREIGN KEY (`Page`) REFERENCES `pc_core_page` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Constraints der Tabelle `pc_news_article` -- ALTER TABLE `pc_news_article` ADD CONSTRAINT `pc_news_article_ibfk_1` FOREIGN KEY (`Author`) REFERENCES `pc_core_user` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `pc_news_article_ibfk_2` FOREIGN KEY (`Category`) REFERENCES `pc_news_category` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints der Tabelle `pc_news_category` -- ALTER TABLE `pc_news_category` ADD CONSTRAINT `pc_news_category_ibfk_3` FOREIGN KEY (`Page`) REFERENCES `pc_core_page` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `pc_news_category_ibfk_1` FOREIGN KEY (`Archive`) REFERENCES `pc_news_archive` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `pc_news_category_ibfk_2` FOREIGN KEY (`Previous`) REFERENCES `pc_news_category` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Constraints der Tabelle `pc_news_content_article` -- ALTER TABLE `pc_news_content_article` ADD CONSTRAINT `pc_news_content_article_ibfk_1` FOREIGN KEY (`Content`) REFERENCES `pc_core_content` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints der Tabelle `pc_news_content_article_list` -- ALTER TABLE `pc_news_content_article_list` ADD CONSTRAINT `pc_news_content_article_list_ibfk_2` FOREIGN KEY (`ArticlePage`) REFERENCES `pc_core_page` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `pc_news_content_article_list_ibfk_1` FOREIGN KEY (`Content`) REFERENCES `pc_core_content` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints der Tabelle `pc_news_content_pager` -- ALTER TABLE `pc_news_content_pager` ADD CONSTRAINT `pc_news_content_pager_ibfk_1` FOREIGN KEY (`Content`) REFERENCES `pc_core_content` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE;
/* Navicat MySQL Data Transfer Source Server : 192.168.172.25 Source Server Type : MySQL Source Server Version : 50726 Source Host : 192.168.172.25 Source Database : renren_fast_test Target Server Type : MySQL Target Server Version : 50726 File Encoding : utf-8 Date: 12/27/2019 09:12:38 AM */ SET NAMES utf8; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for `QRTZ_BLOB_TRIGGERS` -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`; CREATE TABLE `QRTZ_BLOB_TRIGGERS` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `BLOB_DATA` blob, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `QRTZ_CALENDARS` -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_CALENDARS`; CREATE TABLE `QRTZ_CALENDARS` ( `SCHED_NAME` varchar(120) NOT NULL, `CALENDAR_NAME` varchar(200) NOT NULL, `CALENDAR` blob NOT NULL, PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `QRTZ_CRON_TRIGGERS` -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_CRON_TRIGGERS`; CREATE TABLE `QRTZ_CRON_TRIGGERS` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `CRON_EXPRESSION` varchar(120) NOT NULL, `TIME_ZONE_ID` varchar(80) DEFAULT NULL, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), CONSTRAINT `QRTZ_CRON_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of `QRTZ_CRON_TRIGGERS` -- ---------------------------- BEGIN; INSERT INTO `QRTZ_CRON_TRIGGERS` VALUES ('RenrenScheduler', 'TASK_1', 'DEFAULT', '0 0/30 * * * ?', 'Asia/Shanghai'); COMMIT; -- ---------------------------- -- Table structure for `QRTZ_FIRED_TRIGGERS` -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_FIRED_TRIGGERS`; CREATE TABLE `QRTZ_FIRED_TRIGGERS` ( `SCHED_NAME` varchar(120) NOT NULL, `ENTRY_ID` varchar(95) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `INSTANCE_NAME` varchar(200) NOT NULL, `FIRED_TIME` bigint(13) NOT NULL, `SCHED_TIME` bigint(13) NOT NULL, `PRIORITY` int(11) NOT NULL, `STATE` varchar(16) NOT NULL, `JOB_NAME` varchar(200) DEFAULT NULL, `JOB_GROUP` varchar(200) DEFAULT NULL, `IS_NONCONCURRENT` varchar(1) DEFAULT NULL, `REQUESTS_RECOVERY` varchar(1) DEFAULT NULL, PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`), KEY `IDX_QRTZ_FT_TRIG_INST_NAME` (`SCHED_NAME`,`INSTANCE_NAME`), KEY `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`), KEY `IDX_QRTZ_FT_J_G` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), KEY `IDX_QRTZ_FT_JG` (`SCHED_NAME`,`JOB_GROUP`), KEY `IDX_QRTZ_FT_T_G` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), KEY `IDX_QRTZ_FT_TG` (`SCHED_NAME`,`TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `QRTZ_JOB_DETAILS` -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_JOB_DETAILS`; CREATE TABLE `QRTZ_JOB_DETAILS` ( `SCHED_NAME` varchar(120) NOT NULL, `JOB_NAME` varchar(200) NOT NULL, `JOB_GROUP` varchar(200) NOT NULL, `DESCRIPTION` varchar(250) DEFAULT NULL, `JOB_CLASS_NAME` varchar(250) NOT NULL, `IS_DURABLE` varchar(1) NOT NULL, `IS_NONCONCURRENT` varchar(1) NOT NULL, `IS_UPDATE_DATA` varchar(1) NOT NULL, `REQUESTS_RECOVERY` varchar(1) NOT NULL, `JOB_DATA` blob, PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), KEY `IDX_QRTZ_J_REQ_RECOVERY` (`SCHED_NAME`,`REQUESTS_RECOVERY`), KEY `IDX_QRTZ_J_GRP` (`SCHED_NAME`,`JOB_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of `QRTZ_JOB_DETAILS` -- ---------------------------- BEGIN; INSERT INTO `QRTZ_JOB_DETAILS` VALUES ('RenrenScheduler', 'TASK_1', 'DEFAULT', null, 'io.renren.modules.job.utils.ScheduleJob', '0', '0', '0', '0', 0xaced0005737200156f72672e71756172747a2e4a6f62446174614d61709fb083e8bfa9b0cb020000787200266f72672e71756172747a2e7574696c732e537472696e674b65794469727479466c61674d61708208e8c3fbc55d280200015a0013616c6c6f77735472616e7369656e74446174617872001d6f72672e71756172747a2e7574696c732e4469727479466c61674d617013e62ead28760ace0200025a000564697274794c00036d617074000f4c6a6176612f7574696c2f4d61703b787001737200116a6176612e7574696c2e486173684d61700507dac1c31660d103000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000c7708000000100000000174000d4a4f425f504152414d5f4b45597372002e696f2e72656e72656e2e6d6f64756c65732e6a6f622e656e746974792e5363686564756c654a6f62456e7469747900000000000000010200074c00086265616e4e616d657400124c6a6176612f6c616e672f537472696e673b4c000a63726561746554696d657400104c6a6176612f7574696c2f446174653b4c000e63726f6e45787072657373696f6e71007e00094c00056a6f6249647400104c6a6176612f6c616e672f4c6f6e673b4c0006706172616d7371007e00094c000672656d61726b71007e00094c00067374617475737400134c6a6176612f6c616e672f496e74656765723b7870740008746573745461736b7372000e6a6176612e7574696c2e44617465686a81014b597419030000787077080000016ed4200aa07874000e3020302f3330202a202a202a203f7372000e6a6176612e6c616e672e4c6f6e673b8be490cc8f23df0200014a000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b0200007870000000000000000174000672656e72656e74000ce58f82e695b0e6b58be8af95737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c75657871007e0013000000007800); COMMIT; -- ---------------------------- -- Table structure for `QRTZ_LOCKS` -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_LOCKS`; CREATE TABLE `QRTZ_LOCKS` ( `SCHED_NAME` varchar(120) NOT NULL, `LOCK_NAME` varchar(40) NOT NULL, PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of `QRTZ_LOCKS` -- ---------------------------- BEGIN; INSERT INTO `QRTZ_LOCKS` VALUES ('RenrenScheduler', 'STATE_ACCESS'), ('RenrenScheduler', 'TRIGGER_ACCESS'); COMMIT; -- ---------------------------- -- Table structure for `QRTZ_PAUSED_TRIGGER_GRPS` -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_PAUSED_TRIGGER_GRPS`; CREATE TABLE `QRTZ_PAUSED_TRIGGER_GRPS` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `QRTZ_SCHEDULER_STATE` -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_SCHEDULER_STATE`; CREATE TABLE `QRTZ_SCHEDULER_STATE` ( `SCHED_NAME` varchar(120) NOT NULL, `INSTANCE_NAME` varchar(200) NOT NULL, `LAST_CHECKIN_TIME` bigint(13) NOT NULL, `CHECKIN_INTERVAL` bigint(13) NOT NULL, PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of `QRTZ_SCHEDULER_STATE` -- ---------------------------- BEGIN; INSERT INTO `QRTZ_SCHEDULER_STATE` VALUES ('RenrenScheduler', 'mikeliu.local1577327181073', '1577409148540', '15000'); COMMIT; -- ---------------------------- -- Table structure for `QRTZ_SIMPLE_TRIGGERS` -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_SIMPLE_TRIGGERS`; CREATE TABLE `QRTZ_SIMPLE_TRIGGERS` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `REPEAT_COUNT` bigint(7) NOT NULL, `REPEAT_INTERVAL` bigint(12) NOT NULL, `TIMES_TRIGGERED` bigint(10) NOT NULL, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), CONSTRAINT `QRTZ_SIMPLE_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `QRTZ_SIMPROP_TRIGGERS` -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_SIMPROP_TRIGGERS`; CREATE TABLE `QRTZ_SIMPROP_TRIGGERS` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `STR_PROP_1` varchar(512) DEFAULT NULL, `STR_PROP_2` varchar(512) DEFAULT NULL, `STR_PROP_3` varchar(512) DEFAULT NULL, `INT_PROP_1` int(11) DEFAULT NULL, `INT_PROP_2` int(11) DEFAULT NULL, `LONG_PROP_1` bigint(20) DEFAULT NULL, `LONG_PROP_2` bigint(20) DEFAULT NULL, `DEC_PROP_1` decimal(13,4) DEFAULT NULL, `DEC_PROP_2` decimal(13,4) DEFAULT NULL, `BOOL_PROP_1` varchar(1) DEFAULT NULL, `BOOL_PROP_2` varchar(1) DEFAULT NULL, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), CONSTRAINT `QRTZ_SIMPROP_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `QRTZ_TRIGGERS` -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_TRIGGERS`; CREATE TABLE `QRTZ_TRIGGERS` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `JOB_NAME` varchar(200) NOT NULL, `JOB_GROUP` varchar(200) NOT NULL, `DESCRIPTION` varchar(250) DEFAULT NULL, `NEXT_FIRE_TIME` bigint(13) DEFAULT NULL, `PREV_FIRE_TIME` bigint(13) DEFAULT NULL, `PRIORITY` int(11) DEFAULT NULL, `TRIGGER_STATE` varchar(16) NOT NULL, `TRIGGER_TYPE` varchar(8) NOT NULL, `START_TIME` bigint(13) NOT NULL, `END_TIME` bigint(13) DEFAULT NULL, `CALENDAR_NAME` varchar(200) DEFAULT NULL, `MISFIRE_INSTR` smallint(2) DEFAULT NULL, `JOB_DATA` blob, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), KEY `IDX_QRTZ_T_J` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), KEY `IDX_QRTZ_T_JG` (`SCHED_NAME`,`JOB_GROUP`), KEY `IDX_QRTZ_T_C` (`SCHED_NAME`,`CALENDAR_NAME`), KEY `IDX_QRTZ_T_G` (`SCHED_NAME`,`TRIGGER_GROUP`), KEY `IDX_QRTZ_T_STATE` (`SCHED_NAME`,`TRIGGER_STATE`), KEY `IDX_QRTZ_T_N_STATE` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), KEY `IDX_QRTZ_T_N_G_STATE` (`SCHED_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), KEY `IDX_QRTZ_T_NEXT_FIRE_TIME` (`SCHED_NAME`,`NEXT_FIRE_TIME`), KEY `IDX_QRTZ_T_NFT_ST` (`SCHED_NAME`,`TRIGGER_STATE`,`NEXT_FIRE_TIME`), KEY `IDX_QRTZ_T_NFT_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`), KEY `IDX_QRTZ_T_NFT_ST_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_STATE`), KEY `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), CONSTRAINT `QRTZ_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `QRTZ_JOB_DETAILS` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of `QRTZ_TRIGGERS` -- ---------------------------- BEGIN; INSERT INTO `QRTZ_TRIGGERS` VALUES ('RenrenScheduler', 'TASK_1', 'DEFAULT', 'TASK_1', 'DEFAULT', null, '1577410200000', '1577408400000', '5', 'WAITING', 'CRON', '1575531577000', '0', null, '2', 0xaced0005737200156f72672e71756172747a2e4a6f62446174614d61709fb083e8bfa9b0cb020000787200266f72672e71756172747a2e7574696c732e537472696e674b65794469727479466c61674d61708208e8c3fbc55d280200015a0013616c6c6f77735472616e7369656e74446174617872001d6f72672e71756172747a2e7574696c732e4469727479466c61674d617013e62ead28760ace0200025a000564697274794c00036d617074000f4c6a6176612f7574696c2f4d61703b787001737200116a6176612e7574696c2e486173684d61700507dac1c31660d103000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000c7708000000100000000174000d4a4f425f504152414d5f4b45597372002e696f2e72656e72656e2e6d6f64756c65732e6a6f622e656e746974792e5363686564756c654a6f62456e7469747900000000000000010200074c00086265616e4e616d657400124c6a6176612f6c616e672f537472696e673b4c000a63726561746554696d657400104c6a6176612f7574696c2f446174653b4c000e63726f6e45787072657373696f6e71007e00094c00056a6f6249647400104c6a6176612f6c616e672f4c6f6e673b4c0006706172616d7371007e00094c000672656d61726b71007e00094c00067374617475737400134c6a6176612f6c616e672f496e74656765723b7870740008746573745461736b7372000e6a6176612e7574696c2e44617465686a81014b597419030000787077080000016ed4200aa07874000e3020302f3330202a202a202a203f7372000e6a6176612e6c616e672e4c6f6e673b8be490cc8f23df0200014a000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b0200007870000000000000000174000672656e72656e74000ce58f82e695b0e6b58be8af95737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c75657871007e0013000000007800); COMMIT; -- ---------------------------- -- Table structure for `schedule_job` -- ---------------------------- DROP TABLE IF EXISTS `schedule_job`; CREATE TABLE `schedule_job` ( `job_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务id', `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称', `params` varchar(2000) DEFAULT NULL COMMENT '参数', `cron_expression` varchar(100) DEFAULT NULL COMMENT 'cron表达式', `status` tinyint(4) DEFAULT NULL COMMENT '任务状态 0:正常 1:暂停', `remark` varchar(255) DEFAULT NULL COMMENT '备注', `create_time` datetime DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`job_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='定时任务'; -- ---------------------------- -- Records of `schedule_job` -- ---------------------------- BEGIN; INSERT INTO `schedule_job` VALUES ('1', 'testTask', 'renren', '0 0/30 * * * ?', '0', '参数测试', '2019-12-05 11:35:00'); COMMIT; -- ---------------------------- -- Table structure for `schedule_job_log` -- ---------------------------- DROP TABLE IF EXISTS `schedule_job_log`; CREATE TABLE `schedule_job_log` ( `log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务日志id', `job_id` bigint(20) NOT NULL COMMENT '任务id', `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称', `params` varchar(2000) DEFAULT NULL COMMENT '参数', `status` tinyint(4) NOT NULL COMMENT '任务状态 0:成功 1:失败', `error` varchar(2000) DEFAULT NULL COMMENT '失败信息', `times` int(11) NOT NULL COMMENT '耗时(单位:毫秒)', `create_time` datetime DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`log_id`), KEY `job_id` (`job_id`) ) ENGINE=InnoDB AUTO_INCREMENT=740 DEFAULT CHARSET=utf8mb4 COMMENT='定时任务日志'; -- ---------------------------- -- Records of `schedule_job_log` -- ---------------------------- BEGIN; INSERT INTO `schedule_job_log` VALUES ('1', '1', 'testTask', 'renren', '0', null, '3', '2019-12-05 16:00:00'), ('2', '1', 'testTask', 'renren', '0', null, '17', '2019-12-05 16:30:00'), ('3', '1', 'testTask', 'renren', '0', null, '3', '2019-12-05 17:00:00'), ('4', '1', 'testTask', 'renren', '0', null, '3', '2019-12-05 18:00:00'), ('5', '1', 'testTask', 'renren', '0', null, '4', '2019-12-05 18:30:00'), ('6', '1', 'testTask', 'renren', '0', null, '33', '2019-12-05 19:00:00'), ('7', '1', 'testTask', 'renren', '0', null, '33', '2019-12-05 19:30:01'), ('8', '1', 'testTask', 'renren', '0', null, '47', '2019-12-05 20:00:00'), ('9', '1', 'testTask', 'renren', '0', null, '4', '2019-12-05 20:30:00'), ('10', '1', 'testTask', 'renren', '0', null, '6', '2019-12-05 21:00:00'), ('11', '1', 'testTask', 'renren', '0', null, '5', '2019-12-05 21:30:00'), ('12', '1', 'testTask', 'renren', '0', null, '2', '2019-12-05 22:00:00'), ('13', '1', 'testTask', 'renren', '0', null, '2', '2019-12-05 22:30:00'), ('14', '1', 'testTask', 'renren', '0', null, '1', '2019-12-05 23:00:00'), ('15', '1', 'testTask', 'renren', '0', null, '2', '2019-12-05 23:30:00'), ('16', '1', 'testTask', 'renren', '0', null, '176', '2019-12-06 00:00:00'), ('17', '1', 'testTask', 'renren', '0', null, '9', '2019-12-06 00:30:00'), ('18', '1', 'testTask', 'renren', '0', null, '3', '2019-12-06 01:00:00'), ('19', '1', 'testTask', 'renren', '0', null, '4', '2019-12-06 01:30:00'), ('20', '1', 'testTask', 'renren', '0', null, '5', '2019-12-06 02:00:00'), ('21', '1', 'testTask', 'renren', '0', null, '2', '2019-12-06 02:30:00'), ('22', '1', 'testTask', 'renren', '0', null, '1', '2019-12-06 03:00:00'), ('23', '1', 'testTask', 'renren', '0', null, '4', '2019-12-06 03:30:00'), ('24', '1', 'testTask', 'renren', '0', null, '3', '2019-12-06 04:00:00'), ('25', '1', 'testTask', 'renren', '0', null, '2', '2019-12-06 04:30:00'), ('26', '1', 'testTask', 'renren', '0', null, '4', '2019-12-06 05:00:00'), ('27', '1', 'testTask', 'renren', '0', null, '8', '2019-12-06 05:30:00'), ('28', '1', 'testTask', 'renren', '0', null, '6', '2019-12-06 06:00:00'), ('29', '1', 'testTask', 'renren', '0', null, '6', '2019-12-06 06:30:00'), ('30', '1', 'testTask', 'renren', '0', null, '5', '2019-12-06 07:00:00'), ('31', '1', 'testTask', 'renren', '0', null, '4', '2019-12-06 07:30:00'), ('32', '1', 'testTask', 'renren', '0', null, '3', '2019-12-06 08:00:00'), ('33', '1', 'testTask', 'renren', '0', null, '5', '2019-12-06 08:30:00'), ('34', '1', 'testTask', 'renren', '0', null, '13', '2019-12-06 09:00:00'), ('35', '1', 'testTask', 'renren', '0', null, '52', '2019-12-06 09:30:00'), ('36', '1', 'testTask', 'renren', '0', null, '9', '2019-12-06 10:00:00'), ('37', '1', 'testTask', 'renren', '0', null, '13', '2019-12-06 10:30:00'), ('38', '1', 'testTask', 'renren', '0', null, '158', '2019-12-06 11:00:00'), ('39', '1', 'testTask', 'renren', '0', null, '9', '2019-12-06 11:30:00'), ('40', '1', 'testTask', 'renren', '0', null, '19', '2019-12-06 12:00:00'), ('41', '1', 'testTask', 'renren', '0', null, '2', '2019-12-06 12:30:00'), ('42', '1', 'testTask', 'renren', '0', null, '5', '2019-12-06 13:00:00'), ('43', '1', 'testTask', 'renren', '0', null, '16', '2019-12-06 13:30:00'), ('44', '1', 'testTask', 'renren', '0', null, '3', '2019-12-06 14:00:00'), ('45', '1', 'testTask', 'renren', '0', null, '12', '2019-12-06 14:30:00'), ('46', '1', 'testTask', 'renren', '0', null, '16', '2019-12-06 15:00:00'), ('47', '1', 'testTask', 'renren', '0', null, '11', '2019-12-06 15:30:01'), ('48', '1', 'testTask', 'renren', '0', null, '1', '2019-12-12 16:30:00'), ('49', '1', 'testTask', 'renren', '0', null, '2', '2019-12-12 17:00:00'), ('50', '1', 'testTask', 'renren', '0', null, '4', '2019-12-12 17:30:00'), ('51', '1', 'testTask', 'renren', '0', null, '2', '2019-12-12 18:00:00'), ('52', '1', 'testTask', 'renren', '0', null, '3', '2019-12-12 18:30:00'), ('53', '1', 'testTask', 'renren', '0', null, '2', '2019-12-12 19:00:00'), ('54', '1', 'testTask', 'renren', '0', null, '2', '2019-12-12 19:30:00'), ('55', '1', 'testTask', 'renren', '0', null, '3', '2019-12-12 20:00:00'), ('56', '1', 'testTask', 'renren', '0', null, '3', '2019-12-12 20:30:00'), ('57', '1', 'testTask', 'renren', '0', null, '3', '2019-12-12 21:00:00'), ('58', '1', 'testTask', 'renren', '0', null, '2', '2019-12-12 21:30:00'), ('59', '1', 'testTask', 'renren', '0', null, '3', '2019-12-12 22:00:00'), ('60', '1', 'testTask', 'renren', '0', null, '1', '2019-12-12 22:30:00'), ('61', '1', 'testTask', 'renren', '0', null, '3', '2019-12-12 23:00:00'), ('62', '1', 'testTask', 'renren', '0', null, '1', '2019-12-12 23:30:00'), ('63', '1', 'testTask', 'renren', '0', null, '125', '2019-12-13 00:00:00'), ('64', '1', 'testTask', 'renren', '0', null, '6', '2019-12-13 00:30:00'), ('65', '1', 'testTask', 'renren', '0', null, '11', '2019-12-13 01:00:00'), ('66', '1', 'testTask', 'renren', '0', null, '0', '2019-12-13 01:30:00'), ('67', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 02:00:00'), ('68', '1', 'testTask', 'renren', '0', null, '2', '2019-12-13 02:30:00'), ('69', '1', 'testTask', 'renren', '0', null, '3', '2019-12-13 03:00:00'), ('70', '1', 'testTask', 'renren', '0', null, '2', '2019-12-13 03:30:00'), ('71', '1', 'testTask', 'renren', '0', null, '2', '2019-12-13 04:00:00'), ('72', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 04:30:00'), ('73', '1', 'testTask', 'renren', '0', null, '2', '2019-12-13 05:00:00'), ('74', '1', 'testTask', 'renren', '0', null, '3', '2019-12-13 05:30:00'), ('75', '1', 'testTask', 'renren', '0', null, '2', '2019-12-13 06:00:00'), ('76', '1', 'testTask', 'renren', '0', null, '3', '2019-12-13 06:30:00'), ('77', '1', 'testTask', 'renren', '0', null, '5', '2019-12-13 07:00:00'), ('78', '1', 'testTask', 'renren', '0', null, '5', '2019-12-13 07:30:00'), ('79', '1', 'testTask', 'renren', '0', null, '0', '2019-12-13 08:00:00'), ('80', '1', 'testTask', 'renren', '0', null, '0', '2019-12-13 08:30:00'), ('81', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 09:00:00'), ('82', '1', 'testTask', 'renren', '0', null, '4', '2019-12-13 09:30:00'), ('83', '1', 'testTask', 'renren', '0', null, '5', '2019-12-13 10:00:00'), ('84', '1', 'testTask', 'renren', '0', null, '6', '2019-12-13 10:30:00'), ('85', '1', 'testTask', 'renren', '0', null, '2', '2019-12-13 11:00:00'), ('86', '1', 'testTask', 'renren', '0', null, '2', '2019-12-13 11:30:00'), ('87', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 12:00:00'), ('88', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 12:30:00'), ('89', '1', 'testTask', 'renren', '0', null, '4', '2019-12-13 13:00:00'), ('90', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 13:30:00'), ('91', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 14:00:00'), ('92', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 14:30:00'), ('93', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 15:00:00'), ('94', '1', 'testTask', 'renren', '0', null, '2', '2019-12-13 15:30:00'), ('95', '1', 'testTask', 'renren', '0', null, '3', '2019-12-13 16:00:00'), ('96', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 16:30:00'), ('97', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 17:00:00'), ('98', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 17:30:00'), ('99', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 18:00:00'), ('100', '1', 'testTask', 'renren', '0', null, '3', '2019-12-13 18:30:00'), ('101', '1', 'testTask', 'renren', '0', null, '0', '2019-12-13 19:00:00'), ('102', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 19:30:00'), ('103', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 20:00:00'), ('104', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 20:30:00'), ('105', '1', 'testTask', 'renren', '0', null, '2', '2019-12-13 21:00:00'), ('106', '1', 'testTask', 'renren', '0', null, '0', '2019-12-13 21:30:00'), ('107', '1', 'testTask', 'renren', '0', null, '2', '2019-12-13 22:00:00'), ('108', '1', 'testTask', 'renren', '0', null, '0', '2019-12-13 22:30:00'), ('109', '1', 'testTask', 'renren', '0', null, '2', '2019-12-13 23:00:00'), ('110', '1', 'testTask', 'renren', '0', null, '1', '2019-12-13 23:30:00'), ('111', '1', 'testTask', 'renren', '0', null, '79', '2019-12-14 00:00:00'), ('112', '1', 'testTask', 'renren', '0', null, '4', '2019-12-14 00:30:00'), ('113', '1', 'testTask', 'renren', '0', null, '1', '2019-12-14 01:00:00'), ('114', '1', 'testTask', 'renren', '0', null, '0', '2019-12-14 01:30:00'), ('115', '1', 'testTask', 'renren', '0', null, '0', '2019-12-14 02:00:00'), ('116', '1', 'testTask', 'renren', '0', null, '1', '2019-12-14 02:30:00'), ('117', '1', 'testTask', 'renren', '0', null, '0', '2019-12-14 03:00:00'), ('118', '1', 'testTask', 'renren', '0', null, '1', '2019-12-14 03:30:00'), ('119', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 04:00:00'), ('120', '1', 'testTask', 'renren', '0', null, '0', '2019-12-14 04:30:00'), ('121', '1', 'testTask', 'renren', '0', null, '4', '2019-12-14 05:00:00'), ('122', '1', 'testTask', 'renren', '0', null, '1', '2019-12-14 05:30:00'), ('123', '1', 'testTask', 'renren', '0', null, '2', '2019-12-14 06:00:00'), ('124', '1', 'testTask', 'renren', '0', null, '0', '2019-12-14 06:30:00'), ('125', '1', 'testTask', 'renren', '0', null, '2', '2019-12-14 07:00:00'), ('126', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 07:30:00'), ('127', '1', 'testTask', 'renren', '0', null, '1', '2019-12-14 08:00:00'), ('128', '1', 'testTask', 'renren', '0', null, '1', '2019-12-14 08:30:00'), ('129', '1', 'testTask', 'renren', '0', null, '4', '2019-12-14 09:00:00'), ('130', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 09:30:00'), ('131', '1', 'testTask', 'renren', '0', null, '1', '2019-12-14 10:00:00'), ('132', '1', 'testTask', 'renren', '0', null, '2', '2019-12-14 10:30:00'), ('133', '1', 'testTask', 'renren', '0', null, '2', '2019-12-14 11:00:00'), ('134', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 11:30:00'), ('135', '1', 'testTask', 'renren', '0', null, '0', '2019-12-14 12:00:00'), ('136', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 12:30:00'), ('137', '1', 'testTask', 'renren', '0', null, '2', '2019-12-14 13:00:00'), ('138', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 13:30:00'), ('139', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 14:00:00'), ('140', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 14:30:00'), ('141', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 15:00:00'), ('142', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 15:30:00'), ('143', '1', 'testTask', 'renren', '0', null, '4', '2019-12-14 16:00:00'), ('144', '1', 'testTask', 'renren', '0', null, '4', '2019-12-14 16:30:00'), ('145', '1', 'testTask', 'renren', '0', null, '1', '2019-12-14 17:00:00'), ('146', '1', 'testTask', 'renren', '0', null, '1', '2019-12-14 17:30:00'), ('147', '1', 'testTask', 'renren', '0', null, '4', '2019-12-14 18:00:00'), ('148', '1', 'testTask', 'renren', '0', null, '1', '2019-12-14 18:30:00'), ('149', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 19:00:00'), ('150', '1', 'testTask', 'renren', '0', null, '1', '2019-12-14 19:30:00'), ('151', '1', 'testTask', 'renren', '0', null, '0', '2019-12-14 20:00:00'), ('152', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 20:30:00'), ('153', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 21:00:00'), ('154', '1', 'testTask', 'renren', '0', null, '4', '2019-12-14 21:30:00'), ('155', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 22:00:00'), ('156', '1', 'testTask', 'renren', '0', null, '3', '2019-12-14 22:30:00'), ('157', '1', 'testTask', 'renren', '0', null, '2', '2019-12-14 23:00:00'), ('158', '1', 'testTask', 'renren', '0', null, '4', '2019-12-14 23:30:00'), ('159', '1', 'testTask', 'renren', '0', null, '7', '2019-12-15 00:00:00'), ('160', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 00:30:00'), ('161', '1', 'testTask', 'renren', '0', null, '0', '2019-12-15 01:00:00'), ('162', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 01:30:00'), ('163', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 02:00:00'), ('164', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 02:30:00'), ('165', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 03:00:00'), ('166', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 03:30:00'), ('167', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 04:00:00'), ('168', '1', 'testTask', 'renren', '0', null, '0', '2019-12-15 04:30:00'), ('169', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 05:00:00'), ('170', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 05:30:00'), ('171', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 06:00:00'), ('172', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 06:30:00'), ('173', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 07:00:00'), ('174', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 07:30:00'), ('175', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 08:00:00'), ('176', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 08:30:00'), ('177', '1', 'testTask', 'renren', '0', null, '4', '2019-12-15 09:00:00'), ('178', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 09:30:00'), ('179', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 10:00:00'), ('180', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 10:30:00'), ('181', '1', 'testTask', 'renren', '0', null, '2', '2019-12-15 11:00:00'), ('182', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 11:30:00'), ('183', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 12:00:00'), ('184', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 12:30:00'), ('185', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 13:00:00'), ('186', '1', 'testTask', 'renren', '0', null, '2', '2019-12-15 13:30:00'), ('187', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 14:00:00'), ('188', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 14:30:00'), ('189', '1', 'testTask', 'renren', '0', null, '4', '2019-12-15 15:00:00'), ('190', '1', 'testTask', 'renren', '0', null, '2', '2019-12-15 15:30:00'), ('191', '1', 'testTask', 'renren', '0', null, '2', '2019-12-15 16:00:00'), ('192', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 16:30:00'), ('193', '1', 'testTask', 'renren', '0', null, '4', '2019-12-15 17:00:00'), ('194', '1', 'testTask', 'renren', '0', null, '2', '2019-12-15 17:30:00'), ('195', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 18:00:00'), ('196', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 18:30:00'), ('197', '1', 'testTask', 'renren', '0', null, '2', '2019-12-15 19:00:00'), ('198', '1', 'testTask', 'renren', '0', null, '1', '2019-12-15 19:30:00'), ('199', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 20:00:00'), ('200', '1', 'testTask', 'renren', '0', null, '0', '2019-12-15 20:30:00'), ('201', '1', 'testTask', 'renren', '0', null, '2', '2019-12-15 21:00:00'), ('202', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 21:30:00'), ('203', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 22:00:00'), ('204', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 22:30:00'), ('205', '1', 'testTask', 'renren', '0', null, '0', '2019-12-15 23:00:00'), ('206', '1', 'testTask', 'renren', '0', null, '3', '2019-12-15 23:30:00'), ('207', '1', 'testTask', 'renren', '0', null, '6', '2019-12-16 00:00:00'), ('208', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 00:30:00'), ('209', '1', 'testTask', 'renren', '0', null, '3', '2019-12-16 01:00:00'), ('210', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 01:30:00'), ('211', '1', 'testTask', 'renren', '0', null, '4', '2019-12-16 02:00:00'), ('212', '1', 'testTask', 'renren', '0', null, '3', '2019-12-16 02:30:00'), ('213', '1', 'testTask', 'renren', '0', null, '4', '2019-12-16 03:00:00'), ('214', '1', 'testTask', 'renren', '0', null, '2', '2019-12-16 03:30:00'), ('215', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 04:00:00'), ('216', '1', 'testTask', 'renren', '0', null, '0', '2019-12-16 04:30:00'), ('217', '1', 'testTask', 'renren', '0', null, '3', '2019-12-16 05:00:00'), ('218', '1', 'testTask', 'renren', '0', null, '3', '2019-12-16 05:30:00'), ('219', '1', 'testTask', 'renren', '0', null, '3', '2019-12-16 06:00:00'), ('220', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 06:30:00'), ('221', '1', 'testTask', 'renren', '0', null, '3', '2019-12-16 07:00:00'), ('222', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 07:30:00'), ('223', '1', 'testTask', 'renren', '0', null, '4', '2019-12-16 08:00:00'), ('224', '1', 'testTask', 'renren', '0', null, '4', '2019-12-16 08:30:00'), ('225', '1', 'testTask', 'renren', '0', null, '3', '2019-12-16 09:00:00'), ('226', '1', 'testTask', 'renren', '0', null, '2', '2019-12-16 09:30:00'), ('227', '1', 'testTask', 'renren', '0', null, '2', '2019-12-16 10:00:00'), ('228', '1', 'testTask', 'renren', '0', null, '14', '2019-12-16 10:30:00'), ('229', '1', 'testTask', 'renren', '0', null, '3', '2019-12-16 11:00:00'), ('230', '1', 'testTask', 'renren', '0', null, '8', '2019-12-16 11:30:00'), ('231', '1', 'testTask', 'renren', '0', null, '4', '2019-12-16 12:00:00'), ('232', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 15:00:00'), ('233', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 15:30:00'), ('234', '1', 'testTask', 'renren', '0', null, '3', '2019-12-16 16:00:00'), ('235', '1', 'testTask', 'renren', '0', null, '2', '2019-12-16 16:30:00'), ('236', '1', 'testTask', 'renren', '0', null, '2', '2019-12-16 17:00:00'), ('237', '1', 'testTask', 'renren', '0', null, '4', '2019-12-16 17:30:00'), ('238', '1', 'testTask', 'renren', '0', null, '3', '2019-12-16 18:00:00'), ('239', '1', 'testTask', 'renren', '0', null, '2', '2019-12-16 18:30:00'), ('240', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 19:00:00'), ('241', '1', 'testTask', 'renren', '0', null, '2', '2019-12-16 19:30:00'), ('242', '1', 'testTask', 'renren', '0', null, '2', '2019-12-16 20:00:00'), ('243', '1', 'testTask', 'renren', '0', null, '0', '2019-12-16 20:30:00'), ('244', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 21:00:00'), ('245', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 21:30:00'), ('246', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 22:00:00'), ('247', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 22:30:00'), ('248', '1', 'testTask', 'renren', '0', null, '1', '2019-12-16 23:00:00'), ('249', '1', 'testTask', 'renren', '0', null, '0', '2019-12-16 23:30:00'), ('250', '1', 'testTask', 'renren', '0', null, '46', '2019-12-17 00:00:00'), ('251', '1', 'testTask', 'renren', '0', null, '4', '2019-12-17 00:30:00'), ('252', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 01:00:00'), ('253', '1', 'testTask', 'renren', '0', null, '3', '2019-12-17 01:30:00'), ('254', '1', 'testTask', 'renren', '0', null, '0', '2019-12-17 02:00:00'), ('255', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 02:30:00'), ('256', '1', 'testTask', 'renren', '0', null, '3', '2019-12-17 03:00:00'), ('257', '1', 'testTask', 'renren', '0', null, '0', '2019-12-17 03:30:00'), ('258', '1', 'testTask', 'renren', '0', null, '3', '2019-12-17 04:00:00'), ('259', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 04:30:00'), ('260', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 05:00:00'), ('261', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 05:30:00'), ('262', '1', 'testTask', 'renren', '0', null, '3', '2019-12-17 06:00:00'), ('263', '1', 'testTask', 'renren', '0', null, '0', '2019-12-17 06:30:00'), ('264', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 07:00:00'), ('265', '1', 'testTask', 'renren', '0', null, '0', '2019-12-17 07:30:00'), ('266', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 08:00:00'), ('267', '1', 'testTask', 'renren', '0', null, '3', '2019-12-17 08:30:00'), ('268', '1', 'testTask', 'renren', '0', null, '0', '2019-12-17 09:00:00'), ('269', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 09:30:00'), ('270', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 10:00:00'), ('271', '1', 'testTask', 'renren', '0', null, '0', '2019-12-17 10:30:00'), ('272', '1', 'testTask', 'renren', '0', null, '4', '2019-12-17 11:00:00'), ('273', '1', 'testTask', 'renren', '0', null, '2', '2019-12-17 11:30:00'), ('274', '1', 'testTask', 'renren', '0', null, '5', '2019-12-17 12:00:00'), ('275', '1', 'testTask', 'renren', '0', null, '3', '2019-12-17 12:30:00'), ('276', '1', 'testTask', 'renren', '0', null, '2', '2019-12-17 13:00:00'), ('277', '1', 'testTask', 'renren', '0', null, '3', '2019-12-17 13:30:00'), ('278', '1', 'testTask', 'renren', '0', null, '2', '2019-12-17 14:00:00'), ('279', '1', 'testTask', 'renren', '0', null, '2', '2019-12-17 14:30:00'), ('280', '1', 'testTask', 'renren', '0', null, '10', '2019-12-17 15:00:00'), ('281', '1', 'testTask', 'renren', '0', null, '6', '2019-12-17 15:30:00'), ('282', '1', 'testTask', 'renren', '0', null, '7', '2019-12-17 16:00:00'), ('283', '1', 'testTask', 'renren', '0', null, '2', '2019-12-17 16:30:00'), ('284', '1', 'testTask', 'renren', '0', null, '2', '2019-12-17 17:00:00'), ('285', '1', 'testTask', 'renren', '0', null, '3', '2019-12-17 17:30:00'), ('286', '1', 'testTask', 'renren', '0', null, '4', '2019-12-17 18:30:00'), ('287', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 19:00:00'), ('288', '1', 'testTask', 'renren', '0', null, '6', '2019-12-17 19:30:00'), ('289', '1', 'testTask', 'renren', '0', null, '9', '2019-12-17 20:30:00'), ('290', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 21:00:00'), ('291', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 21:30:00'), ('292', '1', 'testTask', 'renren', '0', null, '2', '2019-12-17 22:00:00'), ('293', '1', 'testTask', 'renren', '0', null, '0', '2019-12-17 22:30:00'), ('294', '1', 'testTask', 'renren', '0', null, '2', '2019-12-17 23:00:00'), ('295', '1', 'testTask', 'renren', '0', null, '1', '2019-12-17 23:30:00'), ('296', '1', 'testTask', 'renren', '0', null, '54', '2019-12-18 00:00:00'), ('297', '1', 'testTask', 'renren', '0', null, '3', '2019-12-18 00:30:00'), ('298', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 01:00:00'), ('299', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 01:30:00'), ('300', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 02:00:00'), ('301', '1', 'testTask', 'renren', '0', null, '0', '2019-12-18 02:30:00'), ('302', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 03:00:00'), ('303', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 03:30:00'), ('304', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 04:00:00'), ('305', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 04:30:00'), ('306', '1', 'testTask', 'renren', '0', null, '2', '2019-12-18 05:00:00'), ('307', '1', 'testTask', 'renren', '0', null, '2', '2019-12-18 05:30:00'), ('308', '1', 'testTask', 'renren', '0', null, '0', '2019-12-18 06:00:00'), ('309', '1', 'testTask', 'renren', '0', null, '4', '2019-12-18 06:30:00'), ('310', '1', 'testTask', 'renren', '0', null, '8', '2019-12-18 07:00:00'), ('311', '1', 'testTask', 'renren', '0', null, '0', '2019-12-18 07:30:00'), ('312', '1', 'testTask', 'renren', '0', null, '3', '2019-12-18 08:00:00'), ('313', '1', 'testTask', 'renren', '0', null, '4', '2019-12-18 08:30:00'), ('314', '1', 'testTask', 'renren', '0', null, '2', '2019-12-18 09:00:00'), ('315', '1', 'testTask', 'renren', '0', null, '50', '2019-12-18 09:30:00'), ('316', '1', 'testTask', 'renren', '0', null, '2', '2019-12-18 10:00:00'), ('317', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 10:30:00'), ('318', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 11:00:00'), ('319', '1', 'testTask', 'renren', '0', null, '6', '2019-12-18 12:00:00'), ('320', '1', 'testTask', 'renren', '0', null, '2', '2019-12-18 12:30:00'), ('321', '1', 'testTask', 'renren', '0', null, '0', '2019-12-18 13:00:00'), ('322', '1', 'testTask', 'renren', '0', null, '2', '2019-12-18 13:30:00'), ('323', '1', 'testTask', 'renren', '0', null, '3', '2019-12-18 14:00:00'), ('324', '1', 'testTask', 'renren', '0', null, '6', '2019-12-18 14:30:00'), ('325', '1', 'testTask', 'renren', '0', null, '5', '2019-12-18 15:00:00'), ('326', '1', 'testTask', 'renren', '0', null, '8', '2019-12-18 15:30:00'), ('327', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 16:00:00'), ('328', '1', 'testTask', 'renren', '0', null, '0', '2019-12-18 16:30:00'), ('329', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 17:00:00'), ('330', '1', 'testTask', 'renren', '0', null, '13', '2019-12-18 17:30:00'), ('331', '1', 'testTask', 'renren', '0', null, '2', '2019-12-18 18:00:00'), ('332', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 18:30:00'), ('333', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 19:00:00'), ('334', '1', 'testTask', 'renren', '0', null, '1', '2019-12-18 19:30:00'), ('335', '1', 'testTask', 'renren', '0', null, '6', '2019-12-18 20:00:00'), ('336', '1', 'testTask', 'renren', '0', null, '3', '2019-12-18 20:30:00'), ('337', '1', 'testTask', 'renren', '0', null, '2', '2019-12-18 21:00:00'), ('338', '1', 'testTask', 'renren', '0', null, '2', '2019-12-18 21:30:00'), ('339', '1', 'testTask', 'renren', '0', null, '5', '2019-12-18 22:00:00'), ('340', '1', 'testTask', 'renren', '0', null, '2', '2019-12-18 22:30:00'), ('341', '1', 'testTask', 'renren', '0', null, '2', '2019-12-18 23:00:00'), ('342', '1', 'testTask', 'renren', '0', null, '3', '2019-12-18 23:30:00'), ('343', '1', 'testTask', 'renren', '0', null, '164', '2019-12-19 00:00:00'), ('344', '1', 'testTask', 'renren', '0', null, '19', '2019-12-19 00:30:00'), ('345', '1', 'testTask', 'renren', '0', null, '2', '2019-12-19 01:00:00'), ('346', '1', 'testTask', 'renren', '0', null, '2', '2019-12-19 01:30:00'), ('347', '1', 'testTask', 'renren', '0', null, '3', '2019-12-19 02:00:00'), ('348', '1', 'testTask', 'renren', '0', null, '3', '2019-12-19 02:30:00'), ('349', '1', 'testTask', 'renren', '0', null, '2', '2019-12-19 03:00:00'), ('350', '1', 'testTask', 'renren', '0', null, '2', '2019-12-19 03:30:00'), ('351', '1', 'testTask', 'renren', '0', null, '7', '2019-12-19 04:00:00'), ('352', '1', 'testTask', 'renren', '0', null, '4', '2019-12-19 04:30:00'), ('353', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 05:00:00'), ('354', '1', 'testTask', 'renren', '0', null, '3', '2019-12-19 05:30:00'), ('355', '1', 'testTask', 'renren', '0', null, '3', '2019-12-19 06:00:00'), ('356', '1', 'testTask', 'renren', '0', null, '2', '2019-12-19 06:30:00'), ('357', '1', 'testTask', 'renren', '0', null, '3', '2019-12-19 07:00:00'), ('358', '1', 'testTask', 'renren', '0', null, '4', '2019-12-19 07:30:00'), ('359', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 08:00:00'), ('360', '1', 'testTask', 'renren', '0', null, '3', '2019-12-19 08:30:00'), ('361', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 09:00:00'), ('362', '1', 'testTask', 'renren', '0', null, '2', '2019-12-19 09:30:00'), ('363', '1', 'testTask', 'renren', '0', null, '0', '2019-12-19 10:00:00'), ('364', '1', 'testTask', 'renren', '0', null, '0', '2019-12-19 10:30:00'), ('365', '1', 'testTask', 'renren', '0', null, '9', '2019-12-19 11:00:00'), ('366', '1', 'testTask', 'renren', '0', null, '2', '2019-12-19 11:30:00'), ('367', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 12:00:00'), ('368', '1', 'testTask', 'renren', '0', null, '4', '2019-12-19 12:30:00'), ('369', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 13:00:00'), ('370', '1', 'testTask', 'renren', '0', null, '3', '2019-12-19 13:30:00'), ('371', '1', 'testTask', 'renren', '0', null, '5', '2019-12-19 14:00:00'), ('372', '1', 'testTask', 'renren', '0', null, '6', '2019-12-19 14:30:00'), ('373', '1', 'testTask', 'renren', '0', null, '2', '2019-12-19 15:00:00'), ('374', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 15:30:00'), ('375', '1', 'testTask', 'renren', '0', null, '38', '2019-12-19 16:00:00'), ('376', '1', 'testTask', 'renren', '0', null, '3', '2019-12-19 16:30:00'), ('377', '1', 'testTask', 'renren', '0', null, '0', '2019-12-19 17:00:00'), ('378', '1', 'testTask', 'renren', '0', null, '125', '2019-12-19 17:30:01'), ('379', '1', 'testTask', 'renren', '0', null, '18', '2019-12-19 18:00:00'), ('380', '1', 'testTask', 'renren', '0', null, '3', '2019-12-19 18:30:00'), ('381', '1', 'testTask', 'renren', '0', null, '16', '2019-12-19 19:00:00'), ('382', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 19:30:00'), ('383', '1', 'testTask', 'renren', '0', null, '44', '2019-12-19 20:00:00'), ('384', '1', 'testTask', 'renren', '0', null, '0', '2019-12-19 20:30:00'), ('385', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 21:00:00'), ('386', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 21:30:00'), ('387', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 22:00:00'), ('388', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 22:30:00'), ('389', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 23:00:00'), ('390', '1', 'testTask', 'renren', '0', null, '1', '2019-12-19 23:30:00'), ('391', '1', 'testTask', 'renren', '0', null, '19', '2019-12-20 00:00:00'), ('392', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 00:30:00'), ('393', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 01:00:00'), ('394', '1', 'testTask', 'renren', '0', null, '1', '2019-12-20 01:30:00'), ('395', '1', 'testTask', 'renren', '0', null, '1', '2019-12-20 02:00:00'), ('396', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 02:30:00'), ('397', '1', 'testTask', 'renren', '0', null, '1', '2019-12-20 03:00:00'), ('398', '1', 'testTask', 'renren', '0', null, '3', '2019-12-20 03:30:00'), ('399', '1', 'testTask', 'renren', '0', null, '1', '2019-12-20 04:00:00'), ('400', '1', 'testTask', 'renren', '0', null, '1', '2019-12-20 04:30:00'), ('401', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 05:00:00'), ('402', '1', 'testTask', 'renren', '0', null, '4', '2019-12-20 05:30:00'), ('403', '1', 'testTask', 'renren', '0', null, '3', '2019-12-20 06:00:00'), ('404', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 06:30:00'), ('405', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 07:00:00'), ('406', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 07:30:00'), ('407', '1', 'testTask', 'renren', '0', null, '3', '2019-12-20 08:00:00'), ('408', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 08:30:00'), ('409', '1', 'testTask', 'renren', '0', null, '15', '2019-12-20 09:00:00'), ('410', '1', 'testTask', 'renren', '0', null, '3', '2019-12-20 09:30:00'), ('411', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 10:00:00'), ('412', '1', 'testTask', 'renren', '0', null, '7', '2019-12-20 10:30:00'), ('413', '1', 'testTask', 'renren', '0', null, '8', '2019-12-20 11:00:01'), ('414', '1', 'testTask', 'renren', '0', null, '1', '2019-12-20 11:30:00'), ('415', '1', 'testTask', 'renren', '0', null, '1', '2019-12-20 12:00:00'), ('416', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 12:30:00'), ('417', '1', 'testTask', 'renren', '0', null, '1', '2019-12-20 13:00:00'), ('418', '1', 'testTask', 'renren', '0', null, '1', '2019-12-20 13:30:00'), ('419', '1', 'testTask', 'renren', '0', null, '6', '2019-12-20 14:00:00'), ('420', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 14:30:00'), ('421', '1', 'testTask', 'renren', '0', null, '1', '2019-12-20 15:00:00'), ('422', '1', 'testTask', 'renren', '0', null, '3', '2019-12-20 15:30:00'), ('423', '1', 'testTask', 'renren', '0', null, '1', '2019-12-20 16:00:00'), ('424', '1', 'testTask', 'renren', '0', null, '3', '2019-12-20 16:30:00'), ('425', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 17:00:00'), ('426', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 17:30:02'), ('427', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 18:00:00'), ('428', '1', 'testTask', 'renren', '0', null, '4', '2019-12-20 18:30:00'), ('429', '1', 'testTask', 'renren', '0', null, '3', '2019-12-20 19:00:00'), ('430', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 19:30:00'), ('431', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 20:00:00'), ('432', '1', 'testTask', 'renren', '0', null, '0', '2019-12-20 20:30:00'), ('433', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 21:00:00'), ('434', '1', 'testTask', 'renren', '0', null, '4', '2019-12-20 21:30:00'), ('435', '1', 'testTask', 'renren', '0', null, '3', '2019-12-20 22:00:00'), ('436', '1', 'testTask', 'renren', '0', null, '3', '2019-12-20 22:30:00'), ('437', '1', 'testTask', 'renren', '0', null, '4', '2019-12-20 23:00:00'), ('438', '1', 'testTask', 'renren', '0', null, '2', '2019-12-20 23:30:00'), ('439', '1', 'testTask', 'renren', '0', null, '182', '2019-12-21 00:00:00'), ('440', '1', 'testTask', 'renren', '0', null, '7', '2019-12-21 00:30:00'), ('441', '1', 'testTask', 'renren', '0', null, '5', '2019-12-21 01:00:00'), ('442', '1', 'testTask', 'renren', '0', null, '9', '2019-12-21 01:30:00'), ('443', '1', 'testTask', 'renren', '0', null, '0', '2019-12-21 02:00:00'), ('444', '1', 'testTask', 'renren', '0', null, '2', '2019-12-21 02:30:00'), ('445', '1', 'testTask', 'renren', '0', null, '3', '2019-12-21 03:00:00'), ('446', '1', 'testTask', 'renren', '0', null, '3', '2019-12-21 03:30:00'), ('447', '1', 'testTask', 'renren', '0', null, '1', '2019-12-21 04:00:00'), ('448', '1', 'testTask', 'renren', '0', null, '4', '2019-12-21 04:30:00'), ('449', '1', 'testTask', 'renren', '0', null, '3', '2019-12-21 05:00:00'), ('450', '1', 'testTask', 'renren', '0', null, '6', '2019-12-21 05:30:00'), ('451', '1', 'testTask', 'renren', '0', null, '3', '2019-12-21 06:00:00'), ('452', '1', 'testTask', 'renren', '0', null, '1', '2019-12-21 06:30:00'), ('453', '1', 'testTask', 'renren', '0', null, '2', '2019-12-21 07:00:00'), ('454', '1', 'testTask', 'renren', '0', null, '1', '2019-12-21 07:30:00'), ('455', '1', 'testTask', 'renren', '0', null, '3', '2019-12-21 08:00:00'), ('456', '1', 'testTask', 'renren', '0', null, '2', '2019-12-21 08:30:00'), ('457', '1', 'testTask', 'renren', '0', null, '1', '2019-12-21 09:00:00'), ('458', '1', 'testTask', 'renren', '0', null, '1', '2019-12-21 09:30:01'), ('459', '1', 'testTask', 'renren', '0', null, '3', '2019-12-21 10:00:00'), ('460', '1', 'testTask', 'renren', '0', null, '2', '2019-12-21 10:30:00'), ('461', '1', 'testTask', 'renren', '0', null, '5', '2019-12-21 11:00:00'), ('462', '1', 'testTask', 'renren', '0', null, '2', '2019-12-21 11:30:00'), ('463', '1', 'testTask', 'renren', '0', null, '0', '2019-12-21 12:00:00'), ('464', '1', 'testTask', 'renren', '0', null, '1', '2019-12-21 12:30:00'), ('465', '1', 'testTask', 'renren', '0', null, '3', '2019-12-21 13:00:00'), ('466', '1', 'testTask', 'renren', '0', null, '2', '2019-12-21 13:30:00'), ('467', '1', 'testTask', 'renren', '0', null, '3', '2019-12-21 14:00:00'), ('468', '1', 'testTask', 'renren', '0', null, '0', '2019-12-21 14:30:00'), ('469', '1', 'testTask', 'renren', '0', null, '2', '2019-12-21 15:00:00'), ('470', '1', 'testTask', 'renren', '0', null, '4', '2019-12-21 15:30:00'), ('471', '1', 'testTask', 'renren', '0', null, '3', '2019-12-21 16:00:00'), ('472', '1', 'testTask', 'renren', '0', null, '2', '2019-12-21 16:30:00'), ('473', '1', 'testTask', 'renren', '0', null, '0', '2019-12-21 17:00:00'), ('474', '1', 'testTask', 'renren', '0', null, '0', '2019-12-21 17:30:00'), ('475', '1', 'testTask', 'renren', '0', null, '1', '2019-12-21 18:00:00'), ('476', '1', 'testTask', 'renren', '0', null, '4', '2019-12-21 18:30:00'), ('477', '1', 'testTask', 'renren', '0', null, '2', '2019-12-21 19:00:00'), ('478', '1', 'testTask', 'renren', '0', null, '2', '2019-12-21 19:30:00'), ('479', '1', 'testTask', 'renren', '0', null, '5', '2019-12-21 20:00:00'), ('480', '1', 'testTask', 'renren', '0', null, '1', '2019-12-21 20:30:00'), ('481', '1', 'testTask', 'renren', '0', null, '5', '2019-12-21 21:00:00'), ('482', '1', 'testTask', 'renren', '0', null, '1', '2019-12-21 21:30:00'), ('483', '1', 'testTask', 'renren', '0', null, '3', '2019-12-21 22:00:00'), ('484', '1', 'testTask', 'renren', '0', null, '1', '2019-12-21 22:30:00'), ('485', '1', 'testTask', 'renren', '0', null, '0', '2019-12-21 23:00:00'), ('486', '1', 'testTask', 'renren', '0', null, '1', '2019-12-21 23:30:00'), ('487', '1', 'testTask', 'renren', '0', null, '5', '2019-12-22 00:00:00'), ('488', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 00:30:00'), ('489', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 01:00:00'), ('490', '1', 'testTask', 'renren', '0', null, '4', '2019-12-22 01:30:00'), ('491', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 02:00:00'), ('492', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 02:30:00'), ('493', '1', 'testTask', 'renren', '0', null, '4', '2019-12-22 03:00:00'), ('494', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 03:30:00'), ('495', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 04:00:00'), ('496', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 04:30:00'), ('497', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 05:00:00'), ('498', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 05:30:00'), ('499', '1', 'testTask', 'renren', '0', null, '4', '2019-12-22 06:00:00'), ('500', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 06:30:00'), ('501', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 07:00:00'), ('502', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 07:30:00'), ('503', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 08:00:00'), ('504', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 08:30:00'), ('505', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 09:00:00'), ('506', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 09:30:00'), ('507', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 10:00:00'), ('508', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 10:30:00'), ('509', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 11:00:00'), ('510', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 11:30:00'), ('511', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 12:00:00'), ('512', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 12:30:00'), ('513', '1', 'testTask', 'renren', '0', null, '0', '2019-12-22 13:00:00'), ('514', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 13:30:00'), ('515', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 14:00:00'), ('516', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 14:30:00'), ('517', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 15:00:00'), ('518', '1', 'testTask', 'renren', '0', null, '4', '2019-12-22 15:30:00'), ('519', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 16:00:00'), ('520', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 16:30:00'), ('521', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 17:00:00'), ('522', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 17:30:00'), ('523', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 18:00:00'), ('524', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 18:30:00'), ('525', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 19:00:00'), ('526', '1', 'testTask', 'renren', '0', null, '0', '2019-12-22 19:30:00'), ('527', '1', 'testTask', 'renren', '0', null, '0', '2019-12-22 20:00:00'), ('528', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 20:30:00'), ('529', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 21:00:00'), ('530', '1', 'testTask', 'renren', '0', null, '1', '2019-12-22 21:30:00'), ('531', '1', 'testTask', 'renren', '0', null, '0', '2019-12-22 22:00:00'), ('532', '1', 'testTask', 'renren', '0', null, '2', '2019-12-22 22:30:00'), ('533', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 23:00:00'), ('534', '1', 'testTask', 'renren', '0', null, '3', '2019-12-22 23:30:00'), ('535', '1', 'testTask', 'renren', '0', null, '6', '2019-12-23 00:00:00'), ('536', '1', 'testTask', 'renren', '0', null, '4', '2019-12-23 00:30:00'), ('537', '1', 'testTask', 'renren', '0', null, '3', '2019-12-23 01:00:00'), ('538', '1', 'testTask', 'renren', '0', null, '0', '2019-12-23 01:30:00'), ('539', '1', 'testTask', 'renren', '0', null, '3', '2019-12-23 02:00:00'), ('540', '1', 'testTask', 'renren', '0', null, '1', '2019-12-23 02:30:00'), ('541', '1', 'testTask', 'renren', '0', null, '4', '2019-12-23 03:00:00'), ('542', '1', 'testTask', 'renren', '0', null, '2', '2019-12-23 03:30:00'), ('543', '1', 'testTask', 'renren', '0', null, '1', '2019-12-23 04:00:00'), ('544', '1', 'testTask', 'renren', '0', null, '0', '2019-12-23 04:30:00'), ('545', '1', 'testTask', 'renren', '0', null, '3', '2019-12-23 05:00:00'), ('546', '1', 'testTask', 'renren', '0', null, '4', '2019-12-23 05:30:00'), ('547', '1', 'testTask', 'renren', '0', null, '3', '2019-12-23 06:00:00'), ('548', '1', 'testTask', 'renren', '0', null, '3', '2019-12-23 06:30:00'), ('549', '1', 'testTask', 'renren', '0', null, '4', '2019-12-23 07:00:00'), ('550', '1', 'testTask', 'renren', '0', null, '2', '2019-12-23 07:30:00'), ('551', '1', 'testTask', 'renren', '0', null, '0', '2019-12-23 08:00:00'), ('552', '1', 'testTask', 'renren', '0', null, '0', '2019-12-23 08:30:00'), ('553', '1', 'testTask', 'renren', '0', null, '1', '2019-12-23 09:00:00'), ('554', '1', 'testTask', 'renren', '0', null, '2', '2019-12-23 09:30:00'), ('555', '1', 'testTask', 'renren', '0', null, '3', '2019-12-23 10:00:00'), ('556', '1', 'testTask', 'renren', '0', null, '4', '2019-12-23 10:30:00'), ('557', '1', 'testTask', 'renren', '0', null, '89', '2019-12-23 11:00:01'), ('558', '1', 'testTask', 'renren', '0', null, '9', '2019-12-23 11:30:00'), ('559', '1', 'testTask', 'renren', '0', null, '5', '2019-12-23 12:00:00'), ('560', '1', 'testTask', 'renren', '0', null, '1', '2019-12-23 12:30:00'), ('561', '1', 'testTask', 'renren', '0', null, '2', '2019-12-23 13:00:00'), ('562', '1', 'testTask', 'renren', '0', null, '1', '2019-12-23 13:30:00'), ('563', '1', 'testTask', 'renren', '0', null, '2', '2019-12-23 14:00:00'), ('564', '1', 'testTask', 'renren', '0', null, '2', '2019-12-23 14:30:00'), ('565', '1', 'testTask', 'renren', '0', null, '4', '2019-12-23 15:00:00'), ('566', '1', 'testTask', 'renren', '0', null, '5', '2019-12-23 15:30:00'), ('567', '1', 'testTask', 'renren', '0', null, '3', '2019-12-23 16:00:00'), ('568', '1', 'testTask', 'renren', '0', null, '0', '2019-12-23 16:30:00'), ('569', '1', 'testTask', 'renren', '0', null, '3', '2019-12-23 17:00:00'), ('570', '1', 'testTask', 'renren', '0', null, '2', '2019-12-23 17:30:00'), ('571', '1', 'testTask', 'renren', '0', null, '3', '2019-12-23 18:00:00'), ('572', '1', 'testTask', 'renren', '0', null, '2', '2019-12-23 18:30:00'), ('573', '1', 'testTask', 'renren', '0', null, '1', '2019-12-23 19:00:00'), ('574', '1', 'testTask', 'renren', '0', null, '2', '2019-12-23 19:30:00'), ('575', '1', 'testTask', 'renren', '0', null, '2', '2019-12-23 20:00:00'), ('576', '1', 'testTask', 'renren', '0', null, '1', '2019-12-23 20:30:00'), ('577', '1', 'testTask', 'renren', '0', null, '7', '2019-12-23 21:00:00'), ('578', '1', 'testTask', 'renren', '0', null, '5', '2019-12-23 21:30:00'), ('579', '1', 'testTask', 'renren', '0', null, '1', '2019-12-23 22:00:00'), ('580', '1', 'testTask', 'renren', '0', null, '0', '2019-12-23 22:30:00'), ('581', '1', 'testTask', 'renren', '0', null, '4', '2019-12-23 23:00:00'), ('582', '1', 'testTask', 'renren', '0', null, '0', '2019-12-23 23:30:00'), ('583', '1', 'testTask', 'renren', '0', null, '140', '2019-12-24 00:00:00'), ('584', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 00:30:00'), ('585', '1', 'testTask', 'renren', '0', null, '0', '2019-12-24 01:00:00'), ('586', '1', 'testTask', 'renren', '0', null, '1', '2019-12-24 01:30:00'), ('587', '1', 'testTask', 'renren', '0', null, '1', '2019-12-24 02:00:00'), ('588', '1', 'testTask', 'renren', '0', null, '0', '2019-12-24 02:30:00'), ('589', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 03:00:00'), ('590', '1', 'testTask', 'renren', '0', null, '1', '2019-12-24 03:30:00'), ('591', '1', 'testTask', 'renren', '0', null, '5', '2019-12-24 04:00:00'), ('592', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 04:30:00'), ('593', '1', 'testTask', 'renren', '0', null, '4', '2019-12-24 05:00:00'), ('594', '1', 'testTask', 'renren', '0', null, '1', '2019-12-24 05:30:00'), ('595', '1', 'testTask', 'renren', '0', null, '0', '2019-12-24 06:00:00'), ('596', '1', 'testTask', 'renren', '0', null, '4', '2019-12-24 06:30:00'), ('597', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 07:00:00'), ('598', '1', 'testTask', 'renren', '0', null, '4', '2019-12-24 07:30:00'), ('599', '1', 'testTask', 'renren', '0', null, '0', '2019-12-24 08:00:00'), ('600', '1', 'testTask', 'renren', '0', null, '6', '2019-12-24 08:30:00'), ('601', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 09:00:00'), ('602', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 09:30:00'), ('603', '1', 'testTask', 'renren', '0', null, '8', '2019-12-24 10:00:00'), ('604', '1', 'testTask', 'renren', '0', null, '8', '2019-12-24 10:30:00'), ('605', '1', 'testTask', 'renren', '0', null, '1', '2019-12-24 11:00:00'), ('606', '1', 'testTask', 'renren', '0', null, '15', '2019-12-24 11:30:00'), ('607', '1', 'testTask', 'renren', '0', null, '3', '2019-12-24 12:00:00'), ('608', '1', 'testTask', 'renren', '0', null, '6', '2019-12-24 12:30:00'), ('609', '1', 'testTask', 'renren', '0', null, '1', '2019-12-24 13:00:00'), ('610', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 13:30:00'), ('611', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 14:00:00'), ('612', '1', 'testTask', 'renren', '0', null, '3', '2019-12-24 14:30:00'), ('613', '1', 'testTask', 'renren', '0', null, '3', '2019-12-24 15:00:00'), ('614', '1', 'testTask', 'renren', '0', null, '4', '2019-12-24 15:30:00'), ('615', '1', 'testTask', 'renren', '0', null, '4', '2019-12-24 16:00:00'), ('616', '1', 'testTask', 'renren', '0', null, '6', '2019-12-24 16:30:00'), ('617', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 17:00:00'), ('618', '1', 'testTask', 'renren', '0', null, '3', '2019-12-24 17:30:00'), ('619', '1', 'testTask', 'renren', '0', null, '6', '2019-12-24 18:00:01'), ('620', '1', 'testTask', 'renren', '0', null, '3', '2019-12-24 18:30:00'), ('621', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 19:00:00'), ('622', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 19:30:00'), ('623', '1', 'testTask', 'renren', '0', null, '8', '2019-12-24 20:00:00'), ('624', '1', 'testTask', 'renren', '0', null, '1', '2019-12-24 20:30:00'), ('625', '1', 'testTask', 'renren', '0', null, '3', '2019-12-24 21:00:00'), ('626', '1', 'testTask', 'renren', '0', null, '2', '2019-12-24 21:30:00'), ('627', '1', 'testTask', 'renren', '0', null, '3', '2019-12-24 22:00:00'), ('628', '1', 'testTask', 'renren', '0', null, '1', '2019-12-24 22:30:00'), ('629', '1', 'testTask', 'renren', '0', null, '3', '2019-12-24 23:00:00'), ('630', '1', 'testTask', 'renren', '0', null, '3', '2019-12-24 23:30:00'), ('631', '1', 'testTask', 'renren', '0', null, '139', '2019-12-25 00:00:00'), ('632', '1', 'testTask', 'renren', '0', null, '12', '2019-12-25 00:30:00'), ('633', '1', 'testTask', 'renren', '0', null, '0', '2019-12-25 01:00:00'), ('634', '1', 'testTask', 'renren', '0', null, '2', '2019-12-25 01:30:00'), ('635', '1', 'testTask', 'renren', '0', null, '1', '2019-12-25 02:00:00'), ('636', '1', 'testTask', 'renren', '0', null, '3', '2019-12-25 02:30:00'), ('637', '1', 'testTask', 'renren', '0', null, '3', '2019-12-25 03:00:00'), ('638', '1', 'testTask', 'renren', '0', null, '2', '2019-12-25 03:30:00'), ('639', '1', 'testTask', 'renren', '0', null, '1', '2019-12-25 04:00:00'), ('640', '1', 'testTask', 'renren', '0', null, '1', '2019-12-25 04:30:00'), ('641', '1', 'testTask', 'renren', '0', null, '2', '2019-12-25 05:00:00'), ('642', '1', 'testTask', 'renren', '0', null, '1', '2019-12-25 05:30:00'), ('643', '1', 'testTask', 'renren', '0', null, '0', '2019-12-25 06:00:00'), ('644', '1', 'testTask', 'renren', '0', null, '3', '2019-12-25 06:30:00'), ('645', '1', 'testTask', 'renren', '0', null, '2', '2019-12-25 07:00:00'), ('646', '1', 'testTask', 'renren', '0', null, '3', '2019-12-25 07:30:00'), ('647', '1', 'testTask', 'renren', '0', null, '2', '2019-12-25 08:00:00'), ('648', '1', 'testTask', 'renren', '0', null, '3', '2019-12-25 08:30:00'), ('649', '1', 'testTask', 'renren', '0', null, '4', '2019-12-25 09:00:00'), ('650', '1', 'testTask', 'renren', '0', null, '5', '2019-12-25 09:30:00'), ('651', '1', 'testTask', 'renren', '0', null, '4', '2019-12-25 10:00:00'), ('652', '1', 'testTask', 'renren', '0', null, '2', '2019-12-25 10:30:00'), ('653', '1', 'testTask', 'renren', '0', null, '5', '2019-12-25 11:00:00'), ('654', '1', 'testTask', 'renren', '0', null, '3', '2019-12-25 11:30:00'), ('655', '1', 'testTask', 'renren', '0', null, '1', '2019-12-25 12:00:00'), ('656', '1', 'testTask', 'renren', '0', null, '0', '2019-12-25 12:30:00'), ('657', '1', 'testTask', 'renren', '0', null, '1', '2019-12-25 13:00:00'), ('658', '1', 'testTask', 'renren', '0', null, '2', '2019-12-25 13:30:00'), ('659', '1', 'testTask', 'renren', '0', null, '6', '2019-12-25 16:30:00'), ('660', '1', 'testTask', 'renren', '0', null, '0', '2019-12-25 17:00:00'), ('661', '1', 'testTask', 'renren', '0', null, '4', '2019-12-25 17:30:00'), ('662', '1', 'testTask', 'renren', '0', null, '17', '2019-12-25 18:00:00'), ('663', '1', 'testTask', 'renren', '0', null, '2', '2019-12-25 18:30:00'), ('664', '1', 'testTask', 'renren', '0', null, '2', '2019-12-25 19:00:00'), ('665', '1', 'testTask', 'renren', '0', null, '2', '2019-12-25 19:30:00'), ('666', '1', 'testTask', 'renren', '0', null, '5', '2019-12-25 20:00:00'), ('667', '1', 'testTask', 'renren', '0', null, '0', '2019-12-25 20:30:00'), ('668', '1', 'testTask', 'renren', '0', null, '2', '2019-12-25 21:00:00'), ('669', '1', 'testTask', 'renren', '0', null, '0', '2019-12-25 21:30:00'), ('670', '1', 'testTask', 'renren', '0', null, '4', '2019-12-25 22:00:00'), ('671', '1', 'testTask', 'renren', '0', null, '1', '2019-12-25 22:30:00'), ('672', '1', 'testTask', 'renren', '0', null, '0', '2019-12-25 23:00:00'), ('673', '1', 'testTask', 'renren', '0', null, '0', '2019-12-25 23:30:00'), ('674', '1', 'testTask', 'renren', '0', null, '101', '2019-12-26 00:00:00'), ('675', '1', 'testTask', 'renren', '0', null, '8', '2019-12-26 00:30:00'), ('676', '1', 'testTask', 'renren', '0', null, '3', '2019-12-26 01:00:00'), ('677', '1', 'testTask', 'renren', '0', null, '1', '2019-12-26 01:30:00'), ('678', '1', 'testTask', 'renren', '0', null, '2', '2019-12-26 02:00:00'), ('679', '1', 'testTask', 'renren', '0', null, '3', '2019-12-26 02:30:00'), ('680', '1', 'testTask', 'renren', '0', null, '2', '2019-12-26 03:00:00'), ('681', '1', 'testTask', 'renren', '0', null, '2', '2019-12-26 03:30:00'), ('682', '1', 'testTask', 'renren', '0', null, '2', '2019-12-26 04:00:00'), ('683', '1', 'testTask', 'renren', '0', null, '2', '2019-12-26 04:30:00'), ('684', '1', 'testTask', 'renren', '0', null, '4', '2019-12-26 05:00:00'), ('685', '1', 'testTask', 'renren', '0', null, '4', '2019-12-26 05:30:00'), ('686', '1', 'testTask', 'renren', '0', null, '6', '2019-12-26 06:00:00'), ('687', '1', 'testTask', 'renren', '0', null, '3', '2019-12-26 06:30:00'), ('688', '1', 'testTask', 'renren', '0', null, '1', '2019-12-26 07:00:00'), ('689', '1', 'testTask', 'renren', '0', null, '0', '2019-12-26 07:30:00'), ('690', '1', 'testTask', 'renren', '0', null, '2', '2019-12-26 08:00:00'), ('691', '1', 'testTask', 'renren', '0', null, '3', '2019-12-26 08:30:00'), ('692', '1', 'testTask', 'renren', '0', null, '2', '2019-12-26 09:00:00'), ('693', '1', 'testTask', 'renren', '0', null, '29', '2019-12-26 09:30:00'), ('694', '1', 'testTask', 'renren', '0', null, '2', '2019-12-26 10:30:00'), ('695', '1', 'testTask', 'renren', '0', null, '7', '2019-12-26 11:00:00'), ('696', '1', 'testTask', 'renren', '0', null, '10', '2019-12-26 11:30:00'), ('697', '1', 'testTask', 'renren', '0', null, '12', '2019-12-26 12:00:00'), ('698', '1', 'testTask', 'renren', '0', null, '3', '2019-12-26 12:30:00'), ('699', '1', 'testTask', 'renren', '0', null, '2', '2019-12-26 13:00:00'), ('700', '1', 'testTask', 'renren', '0', null, '2', '2019-12-26 13:30:00'), ('701', '1', 'testTask', 'renren', '0', null, '3', '2019-12-26 14:00:00'), ('702', '1', 'testTask', 'renren', '0', null, '3', '2019-12-26 14:30:00'), ('703', '1', 'testTask', 'renren', '0', null, '8', '2019-12-26 15:00:00'), ('704', '1', 'testTask', 'renren', '0', null, '4', '2019-12-26 15:30:00'), ('705', '1', 'testTask', 'renren', '0', null, '9', '2019-12-26 16:00:00'), ('706', '1', 'testTask', 'renren', '0', null, '19', '2019-12-26 16:30:00'), ('707', '1', 'testTask', 'renren', '0', null, '4', '2019-12-26 17:00:00'), ('708', '1', 'testTask', 'renren', '0', null, '20', '2019-12-26 17:30:00'), ('709', '1', 'testTask', 'renren', '0', null, '7', '2019-12-26 18:00:00'), ('710', '1', 'testTask', 'renren', '0', null, '6', '2019-12-26 18:30:00'), ('711', '1', 'testTask', 'renren', '0', null, '5', '2019-12-26 19:00:00'), ('712', '1', 'testTask', 'renren', '0', null, '1', '2019-12-26 19:30:00'), ('713', '1', 'testTask', 'renren', '0', null, '3', '2019-12-26 20:00:00'), ('714', '1', 'testTask', 'renren', '0', null, '17', '2019-12-26 20:30:00'), ('715', '1', 'testTask', 'renren', '0', null, '4', '2019-12-26 21:00:00'), ('716', '1', 'testTask', 'renren', '0', null, '9', '2019-12-26 21:30:00'), ('717', '1', 'testTask', 'renren', '0', null, '3', '2019-12-26 22:00:00'), ('718', '1', 'testTask', 'renren', '0', null, '5', '2019-12-26 22:30:00'), ('719', '1', 'testTask', 'renren', '0', null, '9', '2019-12-26 23:00:00'), ('720', '1', 'testTask', 'renren', '0', null, '5', '2019-12-26 23:30:00'), ('721', '1', 'testTask', 'renren', '0', null, '345', '2019-12-27 00:00:00'), ('722', '1', 'testTask', 'renren', '0', null, '17', '2019-12-27 00:30:00'), ('723', '1', 'testTask', 'renren', '0', null, '2', '2019-12-27 01:00:00'), ('724', '1', 'testTask', 'renren', '0', null, '6', '2019-12-27 01:30:00'), ('725', '1', 'testTask', 'renren', '0', null, '2', '2019-12-27 02:00:00'), ('726', '1', 'testTask', 'renren', '0', null, '18', '2019-12-27 02:30:00'), ('727', '1', 'testTask', 'renren', '0', null, '3', '2019-12-27 03:00:00'), ('728', '1', 'testTask', 'renren', '0', null, '2', '2019-12-27 03:30:00'), ('729', '1', 'testTask', 'renren', '0', null, '1', '2019-12-27 04:00:00'), ('730', '1', 'testTask', 'renren', '0', null, '0', '2019-12-27 04:30:00'), ('731', '1', 'testTask', 'renren', '0', null, '6', '2019-12-27 05:00:00'), ('732', '1', 'testTask', 'renren', '0', null, '1', '2019-12-27 05:30:00'), ('733', '1', 'testTask', 'renren', '0', null, '1', '2019-12-27 06:00:00'), ('734', '1', 'testTask', 'renren', '0', null, '1', '2019-12-27 06:30:00'), ('735', '1', 'testTask', 'renren', '0', null, '4', '2019-12-27 07:00:00'), ('736', '1', 'testTask', 'renren', '0', null, '1', '2019-12-27 07:30:00'), ('737', '1', 'testTask', 'renren', '0', null, '2', '2019-12-27 08:00:00'), ('738', '1', 'testTask', 'renren', '0', null, '0', '2019-12-27 08:30:00'), ('739', '1', 'testTask', 'renren', '0', null, '0', '2019-12-27 09:00:00'); COMMIT; -- ---------------------------- -- Table structure for `sys_captcha` -- ---------------------------- DROP TABLE IF EXISTS `sys_captcha`; CREATE TABLE `sys_captcha` ( `uuid` char(36) NOT NULL COMMENT 'uuid', `code` varchar(6) NOT NULL COMMENT '验证码', `expire_time` datetime DEFAULT NULL COMMENT '过期时间', PRIMARY KEY (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统验证码'; -- ---------------------------- -- Records of `sys_captcha` -- ---------------------------- BEGIN; INSERT INTO `sys_captcha` VALUES ('0f5e28ce-69c3-4a0e-8cae-47bce0eb091e', 'cn7eb', '2019-12-13 09:27:30'), ('2b9e9188-cf19-4753-8c35-53da860def58', '5ge27', '2019-12-25 17:37:23'), ('2bc55799-b685-4f9a-8981-bb2773e3ed07', 'd2pna', '2019-12-19 10:18:43'), ('3363b3f0-8188-4d5f-8183-56866c0a312e', 'mpad5', '2019-12-20 08:58:17'), ('346d3161-4bc8-4e72-8456-0060f0a068e2', '85p7a', '2019-12-17 16:04:10'), ('43ba18a3-01ad-462a-8b5f-b10a380d351c', '24m8y', '2019-12-13 09:42:27'), ('4ad1c977-af0d-4c8a-869e-22321ab04b6d', '7db43', '2019-12-13 09:30:16'), ('71b5417a-26f0-4dc9-8e05-424c940d171f', '5em85', '2019-12-19 20:33:11'), ('8497530a-adf8-4f68-8c9f-eeab1640cc71', 'dp46x', '2019-12-05 19:27:18'), ('8fcf2c45-f10f-40be-829d-72f4322bf3c5', 'fn43d', '2019-12-13 09:38:08'), ('95d66da9-461b-4b33-879c-a36316a6d552', '3nd32', '2019-12-26 09:46:25'), ('a2933735-ec7a-43da-8917-3ad97f9901a9', 'mn3xx', '2019-12-13 09:33:51'), ('c70fe155-e54c-405f-8793-fcf5210e9f55', 'abbnb', '2019-12-12 16:09:14'), ('c974f019-91f8-4def-84e6-db6e21642fa2', 'y5mnn', '2019-12-16 14:58:31'), ('d64b09d1-80bd-419d-84f9-2f7e4f79db53', 'y3n26', '2019-12-05 18:42:12'), ('d9371ce9-38a6-4de1-8abd-da325d3e80ec', '5p7ac', '2019-12-12 15:56:31'), ('fc5b5859-b45e-4831-8676-2652e7bd3a3d', 'cyf5w', '2019-12-05 18:46:02'); COMMIT; -- ---------------------------- -- Table structure for `sys_config` -- ---------------------------- DROP TABLE IF EXISTS `sys_config`; CREATE TABLE `sys_config` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `param_key` varchar(50) DEFAULT NULL COMMENT 'key', `param_value` varchar(2000) DEFAULT NULL COMMENT 'value', `status` tinyint(4) DEFAULT '1' COMMENT '状态 0:隐藏 1:显示', `remark` varchar(500) DEFAULT NULL COMMENT '备注', PRIMARY KEY (`id`), UNIQUE KEY `param_key` (`param_key`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COMMENT='系统配置信息表'; -- ---------------------------- -- Records of `sys_config` -- ---------------------------- BEGIN; INSERT INTO `sys_config` VALUES ('1', 'CLOUD_STORAGE_CONFIG_KEY', '{\"aliyunAccessKeyId\":\"\",\"aliyunAccessKeySecret\":\"\",\"aliyunBucketName\":\"\",\"aliyunDomain\":\"\",\"aliyunEndPoint\":\"\",\"aliyunPrefix\":\"\",\"qcloudBucketName\":\"\",\"qcloudDomain\":\"\",\"qcloudPrefix\":\"\",\"qcloudSecretId\":\"\",\"qcloudSecretKey\":\"\",\"qiniuAccessKey\":\"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ\",\"qiniuBucketName\":\"ios-app\",\"qiniuDomain\":\"http://7xqbwh.dl1.z0.glb.clouddn.com\",\"qiniuPrefix\":\"upload\",\"qiniuSecretKey\":\"<KEY>\",\"type\":1}', '0', '云存储配置信息'), ('5', 'MASTER_JMETER_HOME_KEY', '/Users/young/Desktop/apache-jmeter-5.0', '1', '本地Jmeter_home绝对路径(Jmeter版本不要高于引擎版本)'), ('6', 'MASTER_JMETER_CASES_HOME_KEY', '/Users/young/Desktop/EstressTestCases', '1', '本地保存用例数据的绝对路径,不要随意切换会导致文件找不到错误'), ('7', 'MASTER_JMETER_USE_SCRIPT_KEY', 'false', '1', 'false:在服务器进程内启动Jmeter压测。true:启动Jmeter_home中的命令压测'), ('8', 'MASTER_JMETER_REPLACE_FILE_KEY', '1', '1', '0:同名文件禁止上传;1:同名文件上传覆盖(禁止上传第二个);2:允许不同用例的同名文件(支持上传覆盖);默认值1'), ('9', 'MASTER_JMETER_GENERATE_REPORT_KEY', 'true', '1', 'true:本地web程序进程生成测试报告,可以多线程并发生成。false:使用Jmeter_home中的命令生成测试报告'), ('10', 'JMETER_THREADGROUP_SET_KEY', 'true', '1', 'true:开启线程组管理功能,上传脚本时线程组配置将入库管理,默认false。'), ('11', 'SCRIPT_SCHEDULER_DURATION_KEY', 'true', '1', 'true:脚本限时执行生效,具体时间由脚本单独配置,是默认值 false:取消脚本限时执行'); COMMIT; -- ---------------------------- -- Table structure for `sys_log` -- ---------------------------- DROP TABLE IF EXISTS `sys_log`; CREATE TABLE `sys_log` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `username` varchar(50) DEFAULT NULL COMMENT '用户名', `operation` varchar(50) DEFAULT NULL COMMENT '用户操作', `method` varchar(200) DEFAULT NULL COMMENT '请求方法', `params` varchar(5000) DEFAULT NULL COMMENT '请求参数', `time` bigint(20) NOT NULL COMMENT '执行时长(毫秒)', `ip` varchar(64) DEFAULT NULL COMMENT 'IP地址', `create_date` datetime DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COMMENT='系统日志'; -- ---------------------------- -- Records of `sys_log` -- ---------------------------- BEGIN; INSERT INTO `sys_log` VALUES ('1', 'admin', '保存菜单', 'io.renren.modules.sys.controller.SysMenuController.save()', '[{\"menuId\":41,\"parentId\":0,\"name\":\"性能测试\",\"url\":\"\",\"perms\":\"\",\"type\":0,\"icon\":\"oss\",\"orderNum\":0}]', '210', '0:0:0:0:0:0:0:1', '2019-12-05 15:01:10'), ('2', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '[{\"menuId\":36,\"parentId\":41,\"name\":\"商品管理\",\"url\":\"generator/goods\",\"type\":1,\"icon\":\"config\",\"orderNum\":6}]', '62', '0:0:0:0:0:0:0:1', '2019-12-05 15:48:49'), ('3', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '[{\"menuId\":42,\"parentId\":41,\"name\":\"性能测试用例\",\"url\":\"performance/performancecase\",\"type\":1,\"icon\":\"config\",\"orderNum\":6}]', '43', '0:0:0:0:0:0:0:1', '2019-12-05 15:49:17'), ('4', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '[{\"menuId\":47,\"parentId\":41,\"name\":\"性能测试用例文件\",\"url\":\"performance/performancecasefile\",\"type\":1,\"icon\":\"config\",\"orderNum\":6}]', '45', '0:0:0:0:0:0:0:1', '2019-12-05 15:49:59'), ('5', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '[{\"menuId\":52,\"parentId\":41,\"name\":\"性能测试分布式节点\",\"url\":\"performance/performanceslave\",\"type\":1,\"icon\":\"config\",\"orderNum\":6}]', '56', '0:0:0:0:0:0:0:1', '2019-12-05 15:50:30'), ('6', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '[{\"menuId\":57,\"parentId\":41,\"name\":\"性能测试报告\",\"url\":\"performance/performancecasereports\",\"type\":1,\"icon\":\"config\",\"orderNum\":6}]', '47', '0:0:0:0:0:0:0:1', '2019-12-05 15:50:58'), ('7', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '[{\"menuId\":62,\"parentId\":41,\"name\":\"线程组管理\",\"url\":\"performance/performancethreadset\",\"type\":1,\"icon\":\"config\",\"orderNum\":6}]', '54', '0:0:0:0:0:0:0:1', '2019-12-05 15:51:24'), ('8', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '[{\"menuId\":67,\"parentId\":41,\"name\":\"调试测试报告\",\"url\":\"performance/debugcasereports\",\"type\":1,\"icon\":\"config\",\"orderNum\":6}]', '43', '0:0:0:0:0:0:0:1', '2019-12-05 15:52:00'), ('9', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '[{\"menuId\":41,\"parentId\":0,\"name\":\"性能测试\",\"url\":\"\",\"perms\":\"\",\"type\":0,\"icon\":\"oss\",\"orderNum\":0}]', '52', '0:0:0:0:0:0:0:1', '2019-12-05 16:17:53'), ('10', 'admin', '删除菜单', 'io.renren.modules.sys.controller.SysMenuController.delete()', '[37]', '204', '0:0:0:0:0:0:0:1', '2019-12-12 16:05:35'), ('11', 'admin', '删除菜单', 'io.renren.modules.sys.controller.SysMenuController.delete()', '[38]', '89', '0:0:0:0:0:0:0:1', '2019-12-12 16:05:47'), ('12', 'admin', '删除菜单', 'io.renren.modules.sys.controller.SysMenuController.delete()', '[39]', '80', '0:0:0:0:0:0:0:1', '2019-12-12 16:05:56'), ('13', 'admin', '删除菜单', 'io.renren.modules.sys.controller.SysMenuController.delete()', '[40]', '70', '0:0:0:0:0:0:0:1', '2019-12-12 16:07:06'), ('14', 'admin', '删除菜单', 'io.renren.modules.sys.controller.SysMenuController.delete()', '[36]', '67', '0:0:0:0:0:0:0:1', '2019-12-12 16:07:16'), ('15', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '[{\"menuId\":1,\"parentId\":0,\"name\":\"系统管理\",\"type\":0,\"icon\":\"system\",\"orderNum\":1}]', '37', '0:0:0:0:0:0:0:1', '2019-12-12 16:19:30'), ('16', 'admin', '保存配置', 'io.renren.modules.sys.controller.SysConfigController.save()', '[{\"id\":2,\"paramKey\":\"ces\",\"paramValue\":\"ss\",\"remark\":\"\"}]', '209', '0:0:0:0:0:0:0:1', '2019-12-16 14:55:56'), ('17', 'admin', '删除配置', 'io.renren.modules.sys.controller.SysConfigController.delete()', '[[2]]', '131', '0:0:0:0:0:0:0:1', '2019-12-16 14:56:02'), ('18', 'admin', '保存配置', 'io.renren.modules.sys.controller.SysConfigController.save()', '[{\"id\":3,\"paramKey\":\"test\",\"paramValue\":\"test\",\"remark\":\"\"}]', '29', '0:0:0:0:0:0:0:1', '2019-12-16 14:56:09'), ('19', 'admin', '保存菜单', 'io.renren.modules.sys.controller.SysMenuController.save()', '[{\"menuId\":72,\"parentId\":42,\"name\":\"上传文件\",\"url\":\"\",\"perms\":\"performance:performancecase:upload\",\"type\":2,\"icon\":\"\",\"orderNum\":0}]', '67', '0:0:0:0:0:0:0:1', '2019-12-16 15:37:39'), ('20', 'admin', '删除配置', 'io.renren.modules.sys.controller.SysConfigController.delete()', '[[3]]', '122', '0:0:0:0:0:0:0:1', '2019-12-16 15:42:05'), ('21', 'admin', '保存配置', 'io.renren.modules.sys.controller.SysConfigController.save()', '[{\"id\":4,\"paramKey\":\"test\",\"paramValue\":\"test\",\"remark\":\"\"}]', '143', '0:0:0:0:0:0:0:1', '2019-12-16 16:04:29'), ('22', 'admin', '删除配置', 'io.renren.modules.sys.controller.SysConfigController.delete()', '[[4]]', '327', '0:0:0:0:0:0:0:1', '2019-12-16 16:04:35'), ('23', 'admin', '保存配置', 'io.renren.modules.sys.controller.SysConfigController.save()', '[{\"id\":5,\"paramKey\":\"MASTER_JMETER_HOME_KEY\",\"paramValue\":\"/Users/young/Desktop/apache-jmeter-5.0\",\"remark\":\"本地Jmeter_home绝对路径(Jmeter版本不要高于引擎版本)\"}]', '35', '0:0:0:0:0:0:0:1', '2019-12-16 16:05:19'), ('24', 'admin', '保存配置', 'io.renren.modules.sys.controller.SysConfigController.save()', '[{\"id\":6,\"paramKey\":\"MASTER_JMETER_CASES_HOME_KEY\",\"paramValue\":\"/Users/young/Desktop/EstressTestCases\",\"remark\":\"本地保存用例数据的绝对路径,不要随意切换会导致文件找不到错误\"}]', '27', '0:0:0:0:0:0:0:1', '2019-12-16 16:06:04'), ('25', 'admin', '保存配置', 'io.renren.modules.sys.controller.SysConfigController.save()', '[{\"id\":7,\"paramKey\":\"MASTER_JMETER_USE_SCRIPT_KEY\",\"paramValue\":\"false\",\"remark\":\"false:在服务器进程内启动Jmeter压测。true:启动Jmeter_home中的命令压测\"}]', '32', '0:0:0:0:0:0:0:1', '2019-12-16 16:06:54'), ('26', 'admin', '保存配置', 'io.renren.modules.sys.controller.SysConfigController.save()', '[{\"id\":8,\"paramKey\":\"MASTER_JMETER_REPLACE_FILE_KEY\",\"paramValue\":\"1\",\"remark\":\"0:同名文件禁止上传;1:同名文件上传覆盖(禁止上传第二个);2:允许不同用例的同名文件(支持上传覆盖);默认值1\"}]', '29', '0:0:0:0:0:0:0:1', '2019-12-16 16:12:04'), ('27', 'admin', '保存配置', 'io.renren.modules.sys.controller.SysConfigController.save()', '[{\"id\":9,\"paramKey\":\"MASTER_JMETER_GENERATE_REPORT_KEY\",\"paramValue\":\"true\",\"remark\":\"true:本地web程序进程生成测试报告,可以多线程并发生成。false:使用Jmeter_home中的命令生成测试报告\"}]', '30', '0:0:0:0:0:0:0:1', '2019-12-16 16:12:40'), ('28', 'admin', '保存配置', 'io.renren.modules.sys.controller.SysConfigController.save()', '[{\"id\":10,\"paramKey\":\"JMETER_THREADGROUP_SET_KEY\",\"paramValue\":\"true\",\"remark\":\"true:开启线程组管理功能,上传脚本时线程组配置将入库管理,默认false。\"}]', '26', '0:0:0:0:0:0:0:1', '2019-12-16 16:13:10'), ('29', 'admin', '保存配置', 'io.renren.modules.sys.controller.SysConfigController.save()', '[{\"id\":11,\"paramKey\":\"SCRIPT_SCHEDULER_DURATION_KEY\",\"paramValue\":\"true\",\"remark\":\"true:脚本限时执行生效,具体时间由脚本单独配置,是默认值 false:取消脚本限时执行\"}]', '27', '0:0:0:0:0:0:0:1', '2019-12-16 16:13:36'); COMMIT; -- ---------------------------- -- Table structure for `sys_menu` -- ---------------------------- DROP TABLE IF EXISTS `sys_menu`; CREATE TABLE `sys_menu` ( `menu_id` bigint(20) NOT NULL AUTO_INCREMENT, `parent_id` bigint(20) DEFAULT NULL COMMENT '父菜单ID,一级菜单为0', `name` varchar(50) DEFAULT NULL COMMENT '菜单名称', `url` varchar(200) DEFAULT NULL COMMENT '菜单URL', `perms` varchar(500) DEFAULT NULL COMMENT '授权(多个用逗号分隔,如:user:list,user:create)', `type` int(11) DEFAULT NULL COMMENT '类型 0:目录 1:菜单 2:按钮', `icon` varchar(50) DEFAULT NULL COMMENT '菜单图标', `order_num` int(11) DEFAULT NULL COMMENT '排序', PRIMARY KEY (`menu_id`) ) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8mb4 COMMENT='菜单管理'; -- ---------------------------- -- Records of `sys_menu` -- ---------------------------- BEGIN; INSERT INTO `sys_menu` VALUES ('1', '0', '系统管理', null, null, '0', 'system', '1'), ('2', '1', '管理员列表', 'sys/user', null, '1', 'admin', '1'), ('3', '1', '角色管理', 'sys/role', null, '1', 'role', '2'), ('4', '1', '菜单管理', 'sys/menu', null, '1', 'menu', '3'), ('5', '1', 'SQL监控', 'http://localhost:8080/renren-fast/druid/sql.html', null, '1', 'sql', '4'), ('6', '1', '定时任务', 'job/schedule', null, '1', 'job', '5'), ('7', '6', '查看', null, 'sys:schedule:list,sys:schedule:info', '2', null, '0'), ('8', '6', '新增', null, 'sys:schedule:save', '2', null, '0'), ('9', '6', '修改', null, 'sys:schedule:update', '2', null, '0'), ('10', '6', '删除', null, 'sys:schedule:delete', '2', null, '0'), ('11', '6', '暂停', null, 'sys:schedule:pause', '2', null, '0'), ('12', '6', '恢复', null, 'sys:schedule:resume', '2', null, '0'), ('13', '6', '立即执行', null, 'sys:schedule:run', '2', null, '0'), ('14', '6', '日志列表', null, 'sys:schedule:log', '2', null, '0'), ('15', '2', '查看', null, 'sys:user:list,sys:user:info', '2', null, '0'), ('16', '2', '新增', null, 'sys:user:save,sys:role:select', '2', null, '0'), ('17', '2', '修改', null, 'sys:user:update,sys:role:select', '2', null, '0'), ('18', '2', '删除', null, 'sys:user:delete', '2', null, '0'), ('19', '3', '查看', null, 'sys:role:list,sys:role:info', '2', null, '0'), ('20', '3', '新增', null, 'sys:role:save,sys:menu:list', '2', null, '0'), ('21', '3', '修改', null, 'sys:role:update,sys:menu:list', '2', null, '0'), ('22', '3', '删除', null, 'sys:role:delete', '2', null, '0'), ('23', '4', '查看', null, 'sys:menu:list,sys:menu:info', '2', null, '0'), ('24', '4', '新增', null, 'sys:menu:save,sys:menu:select', '2', null, '0'), ('25', '4', '修改', null, 'sys:menu:update,sys:menu:select', '2', null, '0'), ('26', '4', '删除', null, 'sys:menu:delete', '2', null, '0'), ('27', '1', '参数管理', 'sys/config', 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', '1', 'config', '6'), ('29', '1', '系统日志', 'sys/log', 'sys:log:list', '1', 'log', '7'), ('30', '1', '文件上传', 'oss/oss', 'sys:oss:all', '1', 'oss', '6'), ('41', '0', '性能测试', '', '', '0', 'oss', '0'), ('42', '41', '性能测试用例', 'performance/performancecase', null, '1', 'config', '6'), ('43', '42', '查看', null, 'performance:performancecase:list,performance:performancecase:info', '2', null, '6'), ('44', '42', '新增', null, 'performance:performancecase:save', '2', null, '6'), ('45', '42', '修改', null, 'performance:performancecase:update', '2', null, '6'), ('46', '42', '删除', null, 'performance:performancecase:delete', '2', null, '6'), ('47', '41', '性能测试用例文件', 'performance/performancecasefile', null, '1', 'config', '6'), ('48', '47', '查看', null, 'performance:performancecasefile:list,performance:performancecasefile:info', '2', null, '6'), ('49', '47', '新增', null, 'performance:performancecasefile:save', '2', null, '6'), ('50', '47', '修改', null, 'performance:performancecasefile:update', '2', null, '6'), ('51', '47', '删除', null, 'performance:performancecasefile:delete', '2', null, '6'), ('52', '41', '性能测试分布式节点', 'performance/performanceslave', null, '1', 'config', '6'), ('53', '52', '查看', null, 'performance:performanceslave:list,performance:performanceslave:info', '2', null, '6'), ('54', '52', '新增', null, 'performance:performanceslave:save', '2', null, '6'), ('55', '52', '修改', null, 'performance:performanceslave:update', '2', null, '6'), ('56', '52', '删除', null, 'performance:performanceslave:delete', '2', null, '6'), ('57', '41', '性能测试报告', 'performance/performancecasereports', null, '1', 'config', '6'), ('58', '57', '查看', null, 'performance:performancecasereports:list,performance:performancecasereports:info', '2', null, '6'), ('59', '57', '新增', null, 'performance:performancecasereports:save', '2', null, '6'), ('60', '57', '修改', null, 'performance:performancecasereports:update', '2', null, '6'), ('61', '57', '删除', null, 'performance:performancecasereports:delete', '2', null, '6'), ('62', '41', '线程组管理', 'performance/performancethreadset', null, '1', 'config', '6'), ('63', '62', '查看', null, 'performance:performancethreadset:list,performance:performancethreadset:info', '2', null, '6'), ('64', '62', '新增', null, 'performance:performancethreadset:save', '2', null, '6'), ('65', '62', '修改', null, 'performance:performancethreadset:update', '2', null, '6'), ('66', '62', '删除', null, 'performance:performancethreadset:delete', '2', null, '6'), ('67', '41', '调试测试报告', 'performance/debugcasereports', null, '1', 'config', '6'), ('68', '67', '查看', null, 'performance:debugcasereports:list,performance:debugcasereports:info', '2', null, '6'), ('69', '67', '新增', null, 'performance:debugcasereports:save', '2', null, '6'), ('70', '67', '修改', null, 'performance:debugcasereports:update', '2', null, '6'), ('71', '67', '删除', null, 'performance:debugcasereports:delete', '2', null, '6'), ('72', '42', '上传文件', '', 'performance:performancecase:upload', '2', '', '0'); COMMIT; -- ---------------------------- -- Table structure for `sys_oss` -- ---------------------------- DROP TABLE IF EXISTS `sys_oss`; CREATE TABLE `sys_oss` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `url` varchar(200) DEFAULT NULL COMMENT 'URL地址', `create_date` datetime DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文件上传'; -- ---------------------------- -- Table structure for `sys_role` -- ---------------------------- DROP TABLE IF EXISTS `sys_role`; CREATE TABLE `sys_role` ( `role_id` bigint(20) NOT NULL AUTO_INCREMENT, `role_name` varchar(100) DEFAULT NULL COMMENT '角色名称', `remark` varchar(100) DEFAULT NULL COMMENT '备注', `create_user_id` bigint(20) DEFAULT NULL COMMENT '创建者ID', `create_time` datetime DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`role_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色'; -- ---------------------------- -- Table structure for `sys_role_menu` -- ---------------------------- DROP TABLE IF EXISTS `sys_role_menu`; CREATE TABLE `sys_role_menu` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `role_id` bigint(20) DEFAULT NULL COMMENT '角色ID', `menu_id` bigint(20) DEFAULT NULL COMMENT '菜单ID', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色与菜单对应关系'; -- ---------------------------- -- Table structure for `sys_user` -- ---------------------------- DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( `user_id` bigint(20) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL COMMENT '用户名', `password` varchar(100) DEFAULT NULL COMMENT '密码', `salt` varchar(20) DEFAULT NULL COMMENT '盐', `email` varchar(100) DEFAULT NULL COMMENT '邮箱', `mobile` varchar(100) DEFAULT NULL COMMENT '手机号', `status` tinyint(4) DEFAULT NULL COMMENT '状态 0:禁用 1:正常', `create_user_id` bigint(20) DEFAULT NULL COMMENT '创建者ID', `create_time` datetime DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`user_id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='系统用户'; -- ---------------------------- -- Records of `sys_user` -- ---------------------------- BEGIN; INSERT INTO `sys_user` VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', '<EMAIL>', '13612345678', '1', '1', '2016-11-11 11:11:11'); COMMIT; -- ---------------------------- -- Table structure for `sys_user_role` -- ---------------------------- DROP TABLE IF EXISTS `sys_user_role`; CREATE TABLE `sys_user_role` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID', `role_id` bigint(20) DEFAULT NULL COMMENT '角色ID', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户与角色对应关系'; -- ---------------------------- -- Table structure for `sys_user_token` -- ---------------------------- DROP TABLE IF EXISTS `sys_user_token`; CREATE TABLE `sys_user_token` ( `user_id` bigint(20) NOT NULL, `token` varchar(100) NOT NULL COMMENT 'token', `expire_time` datetime DEFAULT NULL COMMENT '过期时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间', PRIMARY KEY (`user_id`), UNIQUE KEY `token` (`token`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统用户Token'; -- ---------------------------- -- Records of `sys_user_token` -- ---------------------------- BEGIN; INSERT INTO `sys_user_token` VALUES ('1', '<PASSWORD>', '2019-12-27 03:15:40', '2019-12-26 15:15:40'); COMMIT; -- ---------------------------- -- Table structure for `tb_user` -- ---------------------------- DROP TABLE IF EXISTS `tb_user`; CREATE TABLE `tb_user` ( `user_id` bigint(20) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL COMMENT '用户名', `mobile` varchar(20) NOT NULL COMMENT '手机号', `password` varchar(64) DEFAULT NULL COMMENT '密码', `create_time` datetime DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`user_id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户'; -- ---------------------------- -- Records of `tb_user` -- ---------------------------- BEGIN; INSERT INTO `tb_user` VALUES ('1', 'mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', '2017-03-23 22:37:41'); COMMIT; -- ---------------------------- -- Table structure for `test_debug_case_reports` -- ---------------------------- DROP TABLE IF EXISTS `test_debug_case_reports`; CREATE TABLE `test_debug_case_reports` ( `report_id` bigint(20) NOT NULL AUTO_INCREMENT, `case_id` bigint(20) NOT NULL COMMENT '所关联的用例', `file_id` bigint(20) NOT NULL COMMENT '所关联的用例文件', `origin_name` varchar(200) NOT NULL COMMENT '测试报告名称', `report_name` varchar(200) NOT NULL COMMENT '避免跨系统编码错误,随机化了结果文件名,存储了相对路径', `file_size` bigint(20) DEFAULT NULL COMMENT '测试结果文件大小', `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态 0:初始状态 1:正在运行 2:成功执行 3:运行出现异常', `remark` varchar(300) DEFAULT NULL COMMENT '描述', `add_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `add_by` bigint(20) DEFAULT NULL COMMENT '提交用户id', `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `update_by` bigint(20) DEFAULT NULL COMMENT '修改用户id', PRIMARY KEY (`report_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='调试/接口测试报告文件表'; -- ---------------------------- -- Table structure for `test_performance_case` -- ---------------------------- DROP TABLE IF EXISTS `test_performance_case`; CREATE TABLE `test_performance_case` ( `case_id` bigint(20) NOT NULL AUTO_INCREMENT, `case_name` varchar(50) NOT NULL COMMENT '用例名', `project` varchar(50) DEFAULT NULL COMMENT '所属项目', `module` varchar(50) DEFAULT NULL COMMENT '所属模块', `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态 0:禁用 1:正常', `operator` varchar(20) DEFAULT NULL COMMENT '拥有者名字', `remark` varchar(300) DEFAULT NULL COMMENT '描述', `priority` int(11) DEFAULT NULL COMMENT '优先级用于过滤', `case_dir` varchar(200) DEFAULT NULL COMMENT 'master节点保存用例信息的文件夹', `add_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `add_by` bigint(20) DEFAULT NULL COMMENT '提交用户id', `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `update_by` bigint(20) DEFAULT NULL COMMENT '修改用户id', PRIMARY KEY (`case_id`), UNIQUE KEY `case_name` (`case_name`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='性能测试用例表'; -- ---------------------------- -- Records of `test_performance_case` -- ---------------------------- BEGIN; INSERT INTO `test_performance_case` VALUES ('1', '登录性能', '测试项目', '测试模块', '0', 'test', 'test', null, '', '2019-12-05 16:28:30', null, '2019-12-05 16:28:30', null), ('4', 'test', 'test', 'test', '0', 'test', 'test', null, '2019-12-16 15:28:26421', '2019-12-16 15:28:47', null, '2019-12-16 15:28:47', null), ('6', 'test3', 'test', 'test', '0', 'test', 'test', null, '2019-12-16 16:15:50226', '2019-12-16 16:16:11', null, '2019-12-16 16:16:11', null); COMMIT; -- ---------------------------- -- Table structure for `test_performance_case_file` -- ---------------------------- DROP TABLE IF EXISTS `test_performance_case_file`; CREATE TABLE `test_performance_case_file` ( `file_id` bigint(20) NOT NULL AUTO_INCREMENT, `case_id` bigint(20) NOT NULL COMMENT '所关联的用例', `slave_id` bigint(20) DEFAULT NULL COMMENT '所关联的同步过的slave子节点', `origin_name` varchar(200) NOT NULL COMMENT '上传的文件名带后缀', `file_name` varchar(200) DEFAULT NULL COMMENT '防止汉字编码错误实际保存的文件名带后缀', `file_md5` varchar(100) DEFAULT NULL COMMENT '文件的MD5对于参数化文件有效主要用于节点的参数化文件校验', `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态 0:初始状态 1:正在运行 2:成功执行 3:运行出现异常 -1:不被搜索出来', `report_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态 0:保存测试报告原始文件 1:不需要测试报告', `webchart_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态 0:需要前端监控 1:不需要前端监控', `debug_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态 0:关闭debug 1:开始debug调试模式', `duration` int(11) NOT NULL DEFAULT '14400' COMMENT '期间,执行时间,单位秒,脚本执行多久停止,0代表永远执行', `add_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `add_by` bigint(20) DEFAULT NULL COMMENT '提交用户id', `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `update_by` bigint(20) DEFAULT NULL COMMENT '修改用户id', PRIMARY KEY (`file_id`), UNIQUE KEY `case_origin_name` (`case_id`,`origin_name`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='性能测试用例文件表'; -- ---------------------------- -- Records of `test_performance_case_file` -- ---------------------------- BEGIN; INSERT INTO `test_performance_case_file` VALUES ('1', '6', null, '6F93BB7BE454FA54388A9BA60C74572B.jpg', '2019-12-16 16:15:50226/6F93BB7BE454FA54388A9BA60C74572B.jpg', '6f93bb7be454fa54388a9ba60c74572b', '0', '0', '0', '0', '14400', '2019-12-20 10:45:17', null, '2019-12-20 10:45:17', null), ('2', '6', null, '秒杀活动.jmx', '2019-12-16 16:15:50226/case2019-12-16 16:16:11441.jmx', '3cafd8bde266e42b5f49015f914d552f', '0', '0', '0', '0', '14400', '2019-12-26 15:27:27', null, '2019-12-26 15:27:49', null); COMMIT; -- ---------------------------- -- Table structure for `test_performance_case_reports` -- ---------------------------- DROP TABLE IF EXISTS `test_performance_case_reports`; CREATE TABLE `test_performance_case_reports` ( `report_id` bigint(20) NOT NULL AUTO_INCREMENT, `case_id` bigint(20) NOT NULL COMMENT '所关联的用例', `file_id` bigint(20) NOT NULL COMMENT '所关联的用例文件', `origin_name` varchar(200) NOT NULL COMMENT '测试报告名称', `report_name` varchar(200) NOT NULL COMMENT '避免跨系统编码错误,实际文件存储的报告名,名称和测试报告文件夹名称一致', `file_size` bigint(20) DEFAULT NULL COMMENT '测试结果文件大小', `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态 0:初始状态 1:正在运行 2:成功执行 3:运行出现异常', `remark` varchar(300) DEFAULT NULL COMMENT '描述', `add_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `add_by` bigint(20) DEFAULT NULL COMMENT '提交用户id', `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `update_by` bigint(20) DEFAULT NULL COMMENT '修改用户id', PRIMARY KEY (`report_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='性能测试报告文件表'; -- ---------------------------- -- Table structure for `test_performance_slave` -- ---------------------------- DROP TABLE IF EXISTS `test_performance_slave`; CREATE TABLE `test_performance_slave` ( `slave_id` bigint(20) NOT NULL AUTO_INCREMENT, `slave_name` varchar(50) NOT NULL COMMENT '子节点名称', `ip` varchar(50) NOT NULL COMMENT 'ip地址', `jmeter_port` int(11) NOT NULL DEFAULT '1099' COMMENT 'Jmeter链接端口号', `user_name` varchar(100) DEFAULT NULL COMMENT '节点机用户名', `passwd` varchar(100) DEFAULT NULL COMMENT '节点机密码', `ssh_port` int(11) NOT NULL DEFAULT '22' COMMENT 'ssh链接端口号', `home_dir` varchar(200) DEFAULT NULL COMMENT '子节点的Jmeter路径', `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态 0:禁用 1:正常', `weight` int(11) NOT NULL DEFAULT '100' COMMENT 'slave节点机的权重,取值在1-99999,slave的权重可以大于或者小于master', `add_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `add_by` bigint(20) DEFAULT NULL COMMENT '提交用户id', `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `update_by` bigint(20) DEFAULT NULL COMMENT '修改用户id', PRIMARY KEY (`slave_id`), UNIQUE KEY `ip` (`ip`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='性能测试分布式节点表'; -- ---------------------------- -- Records of `test_performance_slave` -- ---------------------------- BEGIN; INSERT INTO `test_performance_slave` VALUES ('1', 'LocalHost', '127.0.0.1', '1099', null, null, '22', '', '0', '100', '2018-06-18 18:18:18', null, '2018-06-18 18:18:18', null); COMMIT; -- ---------------------------- -- Table structure for `test_performance_thread_set` -- ---------------------------- DROP TABLE IF EXISTS `test_performance_thread_set`; CREATE TABLE `test_performance_thread_set` ( `set_id` varchar(40) NOT NULL, `parent_id` varchar(40) DEFAULT NULL COMMENT '所属ID,一级配置为0', `name` varchar(100) DEFAULT NULL COMMENT '配置名称', `key` varchar(100) DEFAULT NULL COMMENT '配置项', `value` varchar(100) DEFAULT NULL COMMENT '配置内容', `type` int(11) DEFAULT NULL COMMENT '类型 0:脚本 1:线程组 2:配置', `explain` varchar(200) DEFAULT NULL COMMENT '配置说明', `order_num` int(11) DEFAULT '0' COMMENT '排序', `file_id` bigint(20) DEFAULT NULL COMMENT '所属脚本文件ID', PRIMARY KEY (`set_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='线程组管理'; SET FOREIGN_KEY_CHECKS = 1;
-- Appointments alter table o_ap_topic add column a_participation_visible bool default true not null; -- VFS alter table o_vfs_metadata add column fk_lastmodified_by bigint default null; alter table o_vfs_metadata add constraint fmeta_modified_by_idx foreign key (fk_lastmodified_by) references o_bs_identity (id); -- Identity alter table o_bs_identity add column expirationdate datetime default null; alter table o_bs_identity add column expirationemaildate datetime default null; -- Teams create table o_teams_meeting ( id bigint not null auto_increment, creationdate datetime not null, lastmodified datetime not null, t_subject varchar(255), t_description varchar(4000), t_main_presenter varchar(255), t_start_date datetime default null, t_leadtime bigint default 0 not null, t_start_with_leadtime datetime, t_end_date datetime default null, t_followuptime bigint default 0 not null, t_end_with_followuptime datetime, t_permanent bool default false, t_join_information varchar(4000), t_guest bool default false not null, t_identifier varchar(64), t_read_identifier varchar(64), t_online_meeting_id varchar(128), t_online_meeting_join_url varchar(2000), t_allowed_presenters varchar(32) default 'EVERYONE', t_access_level varchar(32) default 'EVERYONE', t_entry_exit_announcement bool default true, t_lobby_bypass_scope varchar(32) default 'ORGANIZATION_AND_FEDERATED', fk_entry_id bigint default null, a_sub_ident varchar(64) default null, fk_group_id bigint default null, fk_creator_id bigint default null, primary key (id) ); alter table o_teams_meeting ENGINE = InnoDB; alter table o_teams_meeting add constraint teams_meet_entry_idx foreign key (fk_entry_id) references o_repositoryentry (repositoryentry_id); alter table o_teams_meeting add constraint teams_meet_grp_idx foreign key (fk_group_id) references o_gp_business (group_id); alter table o_teams_meeting add constraint teams_meet_creator_idx foreign key (fk_creator_id) references o_bs_identity (id); create table o_teams_user ( id bigint not null auto_increment, creationdate datetime not null, lastmodified datetime not null, t_identifier varchar(128), t_displayname varchar(512), fk_identity_id bigint default null, unique(fk_identity_id), primary key (id) ); alter table o_teams_user ENGINE = InnoDB; alter table o_teams_user add constraint teams_user_ident_idx foreign key (fk_identity_id) references o_bs_identity (id); create table o_teams_attendee ( id bigint not null auto_increment, creationdate datetime not null, lastmodified datetime not null, t_role varchar(32), t_join_date datetime not null, fk_identity_id bigint default null, fk_teams_user_id bigint default null, fk_meeting_id bigint not null, primary key (id) ); alter table o_teams_attendee ENGINE = InnoDB; alter table o_teams_attendee add constraint teams_att_ident_idx foreign key (fk_identity_id) references o_bs_identity (id); alter table o_teams_attendee add constraint teams_att_user_idx foreign key (fk_teams_user_id) references o_teams_user (id); alter table o_teams_attendee add constraint teams_att_meet_idx foreign key (fk_meeting_id) references o_teams_meeting (id); alter table o_ap_appointment add column fk_teams_id bigint; alter table o_ap_appointment add constraint ap_appointment_teams_idx foreign key (fk_teams_id) references o_teams_meeting (id);
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Database: `entrance` -- DROP SCHEMA IF EXISTS `entrance`; CREATE SCHEMA `entrance`; USE `entrance`; -- -------------------------------------------------------- -- -- Table structure for table `category` -- DROP TABLE IF EXISTS `category`; CREATE TABLE IF NOT EXISTS `category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(200) NOT NULL, `time` int(11), PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; -- -- Dumping data for table `category` -- -- -------------------------------------------------------- -- -- Table structure for table `choice` -- DROP TABLE IF EXISTS `choice`; CREATE TABLE IF NOT EXISTS `choice` ( `id` int(11) NOT NULL AUTO_INCREMENT, `questionid` int(11) NOT NULL, `choice` varchar(50) NOT NULL, `answer` varchar(50) NOT NULL, `file` text NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; -- -- Dumping data for table `choice` -- -- -------------------------------------------------------- -- -- Table structure for table `courses` -- DROP TABLE IF EXISTS `courses`; CREATE TABLE IF NOT EXISTS `courses` ( `id` int(11) NOT NULL AUTO_INCREMENT, `coursecode` varchar(100) NOT NULL, `coursename` varchar(255) NOT NULL, `passing_score` varchar(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; -- -- Dumping data for table `courses` -- -- -------------------------------------------------------- -- -- Table structure for table `exam_sched` -- DROP TABLE IF EXISTS `exam_sched`; CREATE TABLE IF NOT EXISTS `exam_sched` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(100) NOT NULL, `start_date` date NOT NULL, `end_date` date NOT NULL, `start_time` varchar(15) NOT NULL, `end_time` varchar(15) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; -- -- Dumping data for table `courses` -- -- -------------------------------------------------------- -- -- Table structure for table `lesson` -- DROP TABLE IF EXISTS `question`; CREATE TABLE IF NOT EXISTS `question` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content` text NOT NULL, `file` text NULL, `category_id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; -- -- Dumping data for table `lesson` -- -- -------------------------------------------------------- -- -- Table structure for table `result` -- DROP TABLE IF EXISTS `result`; CREATE TABLE IF NOT EXISTS `result` ( `id` int(11) NOT NULL AUTO_INCREMENT, `category_id` int(11) NOT NULL, `stud_id` varchar(50) NOT NULL, `score` int(11) NOT NULL, `total` int(11) NOT NULL, `date` DATETIME NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; -- -- Dumping data for table `result` -- -- -------------------------------------------------------- -- -- Table structure for table `status` -- DROP TABLE IF EXISTS `status`; CREATE TABLE IF NOT EXISTS `status` ( `id` int(11) NOT NULL AUTO_INCREMENT, `stud_id` varchar(50) NOT NULL, `question_id` int(11) NOT NULL, `category_id` int(11) NOT NULL, `choice_id` int(11) NOT NULL, `has_quiz` tinyint(4) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; -- -- Dumping data for table `status` -- -- -------------------------------------------------------- -- -- Table structure for table `sms` -- DROP TABLE IF EXISTS `sms`; CREATE TABLE IF NOT EXISTS `sms` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mobileno` varchar(45) NOT NULL, `message` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; -- -- Dumping data for table `category` -- -- -------------------------------------------------------- -- -- Table structure for table `student` -- DROP TABLE IF EXISTS `student`; CREATE TABLE IF NOT EXISTS `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `studid` varchar(50) NOT NULL, `fname` varchar(100) NOT NULL, `lname` varchar(100) NOT NULL, `gender` varchar(10) NOT NULL, `mobileno` varchar(45) NOT NULL, `email` varchar(45) NOT NULL, `address` varchar(45) NULL, `birthdate` date NULL, `graduated` date NULL, `last_school` varchar(100) NULL, `pref_course` int(11) NULL, `user_id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; -- -- Dumping data for table `student` -- -- -------------------------------------------------------- -- -- Table structure for table `userdata` -- DROP TABLE IF EXISTS `userdata`; CREATE TABLE IF NOT EXISTS `userdata` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(100) NOT NULL, `password` varchar(100) NOT NULL, `str_password` varchar(100) NOT NULL, `fname` varchar(100) NOT NULL, `lname` varchar(100) NOT NULL, `email` varchar(45) NOT NULL, `mobileno` varchar(45) NOT NULL, `level` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; -- -- Dumping data for table `userdata` INSERT INTO `userdata` VALUES ('1', 'admin', 'd033e22ae348aeb5660fc2140aec35850c4da997','admin','Admin','Admin','<EMAIL>','12345678910','Admin'); ALTER TABLE `question` ADD KEY `FK_question_1` (`category_id`), ADD CONSTRAINT `FK_question_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `choice` ADD KEY `FK_choices_1` (`questionid`), ADD CONSTRAINT `FK_choices_1` FOREIGN KEY (`questionid`) REFERENCES `question` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `result` ADD KEY `FK_result_1` (`stud_id`); ALTER TABLE `student` ADD KEY `FK_student_1` (`pref_course`), ADD KEY `FK_student_2` (`user_id`), ADD CONSTRAINT `FK_student_1` FOREIGN KEY (`pref_course`) REFERENCES `courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `FK_student_2` FOREIGN KEY (`user_id`) REFERENCES `userdata` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; /*ALTER TABLE `status` ADD KEY `FK_status_1` (`stud_id`),ADD KEY `FK_status_2` (`question_id`), ADD CONSTRAINT `FK_status_1` FOREIGN KEY (`stud_id`) REFERENCES `student` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `FK_status_2` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;*/
//// CHANGE name=change0 create table TableSuffixTest ( idField int not null , PRIMARY KEY CLUSTERED ( idField ) on 'default' ) lock datarows with exp_row_size = 1 on 'default' GO
<reponame>mikesep/comdb2<filename>tests/datetime.test/t09.sql create table t8 { schema { int i datetime dt dbstore="ARANDOMSTRING" } }$$
ALTER TABLE "selfservice_login_flows" DROP COLUMN "messages";
CREATE OR REPLACE FUNCTION jobcenter.do_lock_task(a_workflow_id integer, a_task_id integer, a_job_id bigint) RETURNS nexttask LANGUAGE plpgsql SET search_path TO jobcenter, pg_catalog, pg_temp AS $function$DECLARE v_args jsonb; v_vars jsonb; v_action_id int; v_inargs jsonb; v_locktype text; v_lockvalue text; v_gotlock boolean DEFAULT false; v_parentjob_id bigint; v_lockjob_id bigint; v_deadlockpath bigint[]; BEGIN -- paranoia check with side effects SELECT arguments, variables, action_id, parentjob_id INTO v_args, v_vars, v_action_id, v_parentjob_id FROM jobs JOIN tasks USING (workflow_id, task_id) JOIN actions USING (action_id) WHERE job_id = a_job_id AND task_id = a_task_id AND workflow_id = a_workflow_id AND actions.type = 'system' AND actions.name = 'lock'; IF NOT FOUND THEN -- FIXME: call do_raise_error instead? RAISE EXCEPTION 'do_lock_task called for non-lock-task %', a_task_id; END IF; --RAISE NOTICE 'do_inargsmap action_id % task_id % args % vars % ', v_action_id, a_task_id, v_args, v_vars; BEGIN v_inargs := do_inargsmap(v_action_id, a_task_id, v_args, v_vars); EXCEPTION WHEN OTHERS THEN RETURN do_raise_error(a_workflow_id, a_task_id, a_job_id, format('caught exception in do_inargsmap sqlstate %s sqlerrm %s', SQLSTATE, SQLERRM)); END; RAISE NOTICE 'do_lock_task v_inargs %', v_inargs; -- and what subscriptions we are actually interested in -- (do_inargsmap has made sure those fields exist?) v_locktype := v_inargs->>'locktype'; v_lockvalue := v_inargs->>'lockvalue'; -- we need an exlusive lock on the locks table to prevent a race condition -- between setting the contented flag and updating job state -- (and maybe for the deadlock detection too) LOCK TABLE locks IN SHARE ROW EXCLUSIVE MODE; BEGIN INSERT INTO locks (job_id, locktype, lockvalue) VALUES (a_job_id, v_locktype, v_lockvalue); v_gotlock := true; EXCEPTION WHEN unique_violation THEN SELECT job_id INTO v_lockjob_id FROM locks WHERE locktype=v_locktype AND lockvalue = v_lockvalue FOR UPDATE; -- select should return something here because of the unique violation IF v_lockjob_id = a_job_id THEN -- we already have the lock v_gotlock := true; -- FIXME: or error? ELSIF v_lockjob_id = v_parentjob_id THEN -- todo: steal lock from parent END IF; END; IF NOT v_gotlock THEN -- mark current lock as contended UPDATE locks SET contended=true WHERE locktype=v_locktype AND lockvalue = v_lockvalue; -- mark ourselves as waiting for this lock UPDATE jobs SET state = 'sleeping', -- FIXME: whut waitforlocktype = v_locktype, waitforlockvalue = v_lockvalue, task_started = now() WHERE job_id = a_job_id; -- now see if we have a cycle of sleeping jobs WITH RECURSIVE detect_deadlock(job_id, path, cycle) AS ( SELECT job_id, ARRAY[job_id] as path, false as cycle FROM jobs WHERE job_id = v_lockjob_id AND state = 'sleeping' UNION ALL SELECT l.job_id, path || l.job_id, l.job_id = ANY(path) FROM jobs j JOIN locks l on j.waitforlocktype=l.locktype AND j.waitforlockvalue=l.lockvalue JOIN detect_deadlock dd ON j.job_id = dd.job_id WHERE j.state = 'sleeping' AND NOT cycle ) SELECT path INTO v_deadlockpath FROM detect_deadlock WHERE cycle=true; IF v_deadlockpath IS NOT NULL THEN -- now what? -- if the error proves fatal then the cleanup trigger -- will cleanup our locks and unlock the other job(s) RETURN do_raise_error(a_workflow_id, a_task_id, a_job_id, format('deadlock trying to get locktype %s lockvalue %s path %s', v_locktype, v_lockvalue, array_to_string(v_deadlockpath, ', ') ) ); END IF; RETURN null; -- no next task END IF; UPDATE jobs SET state = 'done', task_started = now(), task_completed = now() WHERE job_id = a_job_id; -- log something INSERT INTO job_task_log (job_id, workflow_id, task_id, task_entered, task_started, task_completed) SELECT job_id, workflow_id, task_id, task_entered, task_started, task_completed FROM jobs WHERE job_id = a_job_id; RETURN do_jobtaskdone(a_workflow_id, a_task_id, a_job_id); END;$function$
-- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Nov 01, 2015 at 04:05 PM -- Server version: 5.6.17 -- PHP Version: 5.5.12 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: `battleships` -- -- -------------------------------------------------------- -- -- Table structure for table `games` -- CREATE TABLE IF NOT EXISTS `games` ( `id` int(11) NOT NULL AUTO_INCREMENT, `coordinates` varchar(100) NOT NULL, `finished` enum('no','yes') NOT NULL DEFAULT 'no', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `shots` -- CREATE TABLE IF NOT EXISTS `shots` ( `id` int(11) NOT NULL AUTO_INCREMENT, `game_id` int(11) NOT NULL, `shot` char(4) NOT NULL, `result` enum('hit','miss') NOT NULL, PRIMARY KEY (`id`), KEY `game_id` (`game_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; /*!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 */;
CREATE DATABASE wildlife; \c wildlife; CREATE TABLE IF NOT EXISTS animals( id SERIAL PRIMARY KEY, sighting_id INTEGER, animal_name VARCHAR ); CREATE TABLE IF NOT EXISTS endangeredAnimals( id SERIAL PRIMARY KEY, animal_name VARCHAR, animal_age VARCHAR, animal_health VARCHAR, sighting_id INTEGER ); CREATE TABLE IF NOT EXISTS sightings( id SERIAL PRIMARY KEY, animal_location VARCHAR, ranger_name VARCHAR sighted_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); --CREATE DATABASE wildlife_test WITH TEMPLATE wildlife;
<gh_stars>0 -- CREATE SCHEMA IF NOT EXISTS backend_test DEFAULT CHARACTER SET utf8; USE node_kafka; -- ----------------------------------------------------- -- Tabela produtos -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS products ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(45) NOT NULL, unitary_value DECIMAL(10,2) NOT NULL, qtd_stock INT NOT NULL, creation_date DATETIME NOT NULL, update_date DATETIME NOT NULL, exclusion_date DATETIME NULL, PRIMARY KEY (id)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Tabela transacoes -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS transactions ( id INT NOT NULL AUTO_INCREMENT, product_id INT NOT NULL, sale_value DECIMAL(10,2) NOT NULL, date_sale DATETIME NULL, status ENUM('APPROVED', 'REJECTED') NOT NULL, PRIMARY KEY (id), CONSTRAINT fk_transactions_products FOREIGN KEY (product_id) REFERENCES products (id) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; INSERT INTO products (name, unitary_value, qtd_stock, creation_date, update_date, exclusion_date) VALUES ('Macbook 13\" 8GB|128SSD|2.7Ghz', 8450.00, 5, '2018-09-20 16:13:44', '2018-09-20 16:13:44', NULL), ('Macbook 13\" 16GB|128SSD|2.7Ghz', 8740.00, 3, '2018-09-20 16:14:34', '2018-09-20 16:14:34', NULL), ('Macbook 13\" 16GB|256SSD|2.7Ghz', 9230.00, 8, '2018-09-20 16:15:19', '2018-09-20 16:15:19', NULL), ('Macbook 13\" 16GB|512SSD|2.7Ghz', 1125.00, 2, '2018-09-20 16:16:43', '2018-09-20 16:16:43', NULL), ('iPhone X 64GB', 4500.00, 10, '2018-09-20 16:18:07', '2018-09-20 16:18:07', NULL), ('iPhone X 128GB', 5800.00, 5, '2018-09-20 16:18:28', '2018-09-20 16:18:28', NULL), ('iPhone X 256GB', 6400.00, 3, '2018-09-20 16:18:49', '2018-09-20 16:18:49', NULL), ('iPad Pro 64GB', 3500.00, 10, '2018-09-20 16:25:18', '2018-09-20 16:25:18', NULL), ('iPad Pro 128GB', 4200.00, 5, '2018-09-20 16:25:52', '2018-09-20 16:25:52', NULL), ( 'iMac Pro 27', 750000.00, 2, '2018-09-20 16:27:22', '2018-09-20 16:27:22', NULL); INSERT INTO transactions (id, product_id, sale_value, date_sale, status) VALUES (1, 1, 8450.00, '2018-09-20 16:31:01', 'APPROVED'), (2, 3, 9230.00, '2018-09-20 16:32:26', 'APPROVED'), (3, 10, 750000.00, '2018-09-20 16:32:47', 'REJECTED'), (4, 8, 3450.00, '2018-09-20 16:33:25', 'APPROVED'), (5, 5, 4400.00, '2018-09-20 16:33:56', 'REJECTED');
start transaction; drop table if exists agents_across_repositories; CREATE TABLE agents_across_repositories ( INDEX (agent_person_id , agent_family_id , agent_corporate_body_id) ) SELECT * FROM agents_view WHERE agent_person_id IN (SELECT T1.agent_person_id FROM agents_view T1 INNER JOIN agents_view T2 ON T1.agent_person_id = T2.agent_person_id WHERE T1.repo_id <> T2.repo_id) UNION ALL SELECT * FROM agents_view WHERE agent_family_id IN (SELECT T1.agent_family_id FROM agents_view T1 INNER JOIN agents_view T2 ON T1.agent_family_id = T2.agent_family_id WHERE T1.repo_id <> T2.repo_id) UNION ALL SELECT * FROM agents_view WHERE agent_corporate_body_id IN (SELECT T1.agent_corporate_body_id FROM agents_view T1 INNER JOIN agents_view T2 ON T1.agent_corporate_body_id = T2.agent_corporate_body_id WHERE T1.repo_id <> T2.repo_id); commit;
<reponame>aanolan51/EmployeeTracker DROP DATABASE IF EXISTS employee_trackerDB; CREATE database employee_trackerDB; USE employee_trackerDB; --This is the main/parent table. The id created here will need to be referenced in the other tables in order to link them-- CREATE TABLE department ( id INT NOT NULL AUTO_INCREMENT, department_name VARCHAR(30) NULL, PRIMARY KEY (id) ); --This table will still have it's own id, but will need to reference the id of the department the role will belong to.-- --department_id : INT to hold reference to department role belongs to-- --To do this, a FOREIGN KEY is used, setting the value of the department_id based on the referenced id that was created in the department table-- --"Foreign keys are what make it possible to join tables to each other." : Taken from https://www.springboard.com/blog/data-science/joining-data-tables/-- -- The reference for the foreign key is the id from the table named department.-- CREATE TABLE role ( id INT NOT NULL AUTO_INCREMENT, title VARCHAR(30) NULL, salary DECIMAL NULL, department_id INT NULL, PRIMARY KEY (id), FOREIGN KEY (department_id) REFERENCES department(id) ); --The employee table will need to reference the role that employee holds, so it will need to link to the role table via the role id-- --The employee table will also need to reference the manager that employee has. So it will need to reference the id given to another employee, --that employee having the manager role designated to them. -- CREATE TABLE employee ( id INT NOT NULL AUTO_INCREMENT, first_name VARCHAR(30) NULL, last_name VARCHAR(30) NULL, role_id INT NULL, manager_id INT NULL, PRIMARY KEY (id), FOREIGN KEY (role_id) REFERENCES role(id) );
<reponame>mkiki/willie-treeregister -------------------------------------------------------------------------------- -- willie-treeregister - Builtin data -------------------------------------------------------------------------------- DELETE FROM treeregister_poi_tree WHERE poiId IN ( 'f1e07bdf-07b5-4230-a3ea-a5eaf542160c', '83a1d7b7-d206-4631-b7de-f447de8c9778', '71d8e14e-6271-48df-9499-95236314aea7', '954c1773-52ec-4cc1-97ee-9c541c47a4a1', '106cdb48-0907-4698-8c21-3e8700500fca', 'c90ae353-a249-4979-bc1b-e451e3fe5af0', 'ce6e45ee-bfa3-422f-b5d5-c5f7364b6244', 'ae08980d-20b6-4cf4-afaa-4f3746d8483e', '74f798ff-3cfd-4482-a73f-a3c97c74b45a', 'e59706d5-426a-4f88-b0c9-fbbd3242df43', 'aa749361-dbac-4e85-8b34-c4409b3c2223', 'ac847657-a051-4ffb-9d60-483d70f83865', '4cda43de-15eb-497a-8ed9-d23d647139f1', '7f72f0d8-2bce-4e68-8e54-d639cd958364', '52b38c97-d3cd-4589-956e-7b614280884e', '2d6ab96c-7481-467f-b6f1-44bd0e1a432a', 'a30813a8-cb44-490b-89be-8b05825d94eb', '455ee9fb-8b0d-4e4e-bc93-5470a16db6d4', 'c6fd1411-99af-4430-8ba6-3f120da0e0e6', 'ce689f4e-6de0-4583-b2d4-88abfc1cd9b5', '39576bf4-84f2-4506-9e2e-627e0edf3b32', '971bc352-7147-4d15-8af7-f407c4980587', 'c2211650-9374-4655-812b-51cc75760c42', '5f8cef2c-df8e-487b-93ea-2bbf9cffaa57', 'e3e84569-e23e-4a81-96d1-42394ae72540', '4eaab8a1-e58b-428b-a92c-636d2af90535', 'c4cb7855-6c80-46d3-ba7c-61531df3e55c', 'd5cfd4d6-9d55-471d-b91c-779b3c032b8f', '77d8a16c-24ae-4847-8d63-7479f21306ad', 'cab4453a-1f35-47f6-9589-6885c7d96427', 'fdbc5ecc-b5f6-469b-b2e9-60580005197e', 'c115c05c-76c2-41d6-9b3c-5e8813425e09', '42e8b7db-7150-4888-bc97-6c4b0c8cc3fb' ); DELETE FROM treeregister_poi WHERE id IN ( 'f1e07bdf-07b5-4230-a3ea-a5eaf542160c', '83a1d7b7-d206-4631-b7de-f447de8c9778', '71d8e14e-6271-48df-9499-95236314aea7', '954c1773-52ec-4cc1-97ee-9c541c47a4a1', '106cdb48-0907-4698-8c21-3e8700500fca', 'c90ae353-a249-4979-bc1b-e451e3fe5af0', 'ce6e45ee-bfa3-422f-b5d5-c5f7364b6244', 'ae08980d-20b6-4cf4-afaa-4f3746d8483e', '74f798ff-3cfd-4482-a73f-a3c97c74b45a', 'e59706d5-426a-4f88-b0c9-fbbd3242df43', 'aa749361-dbac-4e85-8b34-c4409b3c2223', 'ac847657-a051-4ffb-9d60-483d70f83865', '4cda43de-15eb-497a-8ed9-d23d647139f1', '7f72f0d8-2bce-4e68-8e54-d639cd958364', '52b38c97-d3cd-4589-956e-7b614280884e', '2d6ab96c-7481-467f-b6f1-44bd0e1a432a', 'a30813a8-cb44-490b-89be-8b05825d94eb', '455ee9fb-8b0d-4e4e-bc93-5470a16db6d4', 'c6fd1411-99af-4430-8ba6-3f120da0e0e6', 'ce689f4e-6de0-4583-b2d4-88abfc1cd9b5', '39576bf4-84f2-4506-9e2e-627e0edf3b32', '971bc352-7147-4d15-8af7-f407c4980587', 'c2211650-9374-4655-812b-51cc75760c42', '5f8cef2c-df8e-487b-93ea-2bbf9cffaa57', 'e3e84569-e23e-4a81-96d1-42394ae72540', '4eaab8a1-e58b-428b-a92c-636d2af90535', 'c4cb7855-6c80-46d3-ba7c-61531df3e55c', 'd5cfd4d6-9d55-471d-b91c-779b3c032b8f', '77d8a16c-24ae-4847-8d63-7479f21306ad', 'cab4453a-1f35-47f6-9589-6885c7d96427', 'fdbc5ecc-b5f6-469b-b2e9-60580005197e', 'c115c05c-76c2-41d6-9b3c-5e8813425e09', '42e8b7db-7150-4888-bc97-6c4b0c8cc3fb' ); -------------------------------------------------------------------------------- -- 1. <NAME>, Thannenkirch, Haut-Rhin -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'f1e07bdf-07b5-4230-a3ea-a5eaf542160c', 'Chêne de la Vierge', 'Appelé "Chêne de la Vierge" ou "Notre Dame des Bois", ce vieux chêne est orné d''une madone qui a été sculptée dans le tronc en 1952. L''arbre se trouve au départ d''un sentier de découverte balisé appelé "Chemin de la carrière" long de 5 kilomètres (environ 3 heures de balade aller/retour).', 'tree1', 'tree', 48.236, 7.311, 0.1, 'Forêt communale de Bergheim', 'Thannenkirch', 'Haut-Rhin', 'France', 'Forêt communale de Bergheim, au bord de la RD 42, direction Haut-Koenigsbourg à la sortie de Thannenkirch, en lisière de forêt', 'Arbres Remarquables dans le Haut-Rhin', '', NULL, false, '/trees/images/trees/FRA - 68 - Chêne de la Vierge/01.jpg', NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'f1e07bdf-07b5-4230-a3ea-a5eaf542160c', '<NAME>', 'Chêne sessile', 22, 3, 200, NULL ); -------------------------------------------------------------------------------- -- Chêne du domaine de la Chapelle, La Chapelle-Montlinard, Cher -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '83a1d7b7-d206-4631-b7de-f447de8c9778', 'Chêne du domaine de la Chapelle', '', 'tree1', 'tree', 47.169197, 2.986949, 1, 'Domaine de la Chapelle', 'La Chapelle-Montlinard', 'Cher', 'France', '', 'Krapo arboricole', 'https://krapooarboricole.wordpress.com/2011/03/11/chenes-du-domaine-de-la-chapelle-la-chapelle-montlinard-cher/', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '83a1d7b7-d206-4631-b7de-f447de8c9778', 'Quercus', 'Chêne', NULL, 9.60, 600, NULL ); -------------------------------------------------------------------------------- -- Gros chêne de Veslon, Barlieu, Cher -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '71d8e14e-6271-48df-9499-95236314aea7', 'Gros chêne de Veslon', '', 'tree1', 'tree', 47.481647, 2.624441, 0.1, 'Veslon', 'Barlieu', 'Cher', 'France', 'Sur la D8 en direction de Barlieu (depuis Vailly-sur-Sauldre), prendre de chemin (Badineau) à gauche le long des sillos à grain sur quelques centaines de mètre. Le chêne est sur la gauche bien dégagé dans un champ. Deux chênes secondaires un peu plus loin, aussi sur la gauche.', 'Krapo arboricole', 'https://krapooarboricole.wordpress.com/2010/01/04/enorme-chene-campagnard-veslon-barlieu-cher/', NULL, --'418fd0f6-50a7-45f5-97ca-41e707a33266', true, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '71d8e14e-6271-48df-9499-95236314aea7', 'Quercus', 'Chêne', 20, 6.80, 300, 400 ); -------------------------------------------------------------------------------- -- Châtaigniers, la Beurthe, Savigny-en-Sancerre, Cher -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '954c1773-52ec-4cc1-97ee-9c541c47a4a1', 'Châtaigniers de la Beurthe', '', 'tree1', 'tree', 47.451033, 2.763753, 0.5, 'Mont à la Beurthe', 'Savigny-en-Sancerre', 'Cher', 'France', '', 'Krapo arboricole', 'https://krapooarboricole.wordpress.com/2009/01/08/quelques-pistes-a-explorer/', NULL, --'8be9a3af-3554-4c05-a456-fa60e977c7be', true, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '954c1773-52ec-4cc1-97ee-9c541c47a4a1', 'Castanea Sativa', 'Châtaignier', NULL, 7, NULL, NULL ); -------------------------------------------------------------------------------- -- Chêne, Cours, Savigny-en-Sancerre, Cher -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '106cdb48-0907-4698-8c21-3e8700500fca', 'Chêne de Cours', '', 'tree1', 'tree', 47.439710, 2.828249, 0.1, 'Cours', 'Savigny-en-Sancerre', 'Cher', 'France', 'Sortie de Savigny en direction de Boulleret, sur le côté droit de la route en bordure de champ dans le hammeau de Cours.', '', '', NULL, --'584d70a4-9cdf-4411-a8b9-c2f6c2bf0f47', true, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '106cdb48-0907-4698-8c21-3e8700500fca', 'Quercus', 'Chêne', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Sequoia, Savigny-en-Sancerre -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'c90ae353-a249-4979-bc1b-e451e3fe5af0', 'Sequoia du cimetière', '', 'tree2', 'tree', 47.440778, 2.807256, 0.1, '', 'Savigny-en-Sancerre', 'Cher', 'France', 'Devant le cimetière de Savigny-en-Sancerre', '', '', NULL, --'e1573274-5031-48c4-ac5d-66e741455eb4', true, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'c90ae353-a249-4979-bc1b-e451e3fe5af0', 'Se<NAME>', 'Séquoia géant', NULL, 6.45, NULL, NULL ); -------------------------------------------------------------------------------- -- Sequoia, Savigny-en-Sancerre -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'ce6e45ee-bfa3-422f-b5d5-c5f7364b6244', 'Chêne de Buranlure', '', 'tree1', 'tree', 47.409442, 2.885504, 0.1, 'Buranlure, Domaine d''en-haut', 'Boulleret', 'Cher', 'France', 'Sur la D55, à la sortie de Cosne, à l''entrée du château de Buranlure', '', '', NULL, --'8eccd99d-f014-40fb-9374-a9d272e7dfb6', true, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'ce6e45ee-bfa3-422f-b5d5-c5f7364b6244', 'Quercus', 'Chêne', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- <NAME> -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'ae08980d-20b6-4cf4-afaa-4f3746d8483e', '<NAME>', '', 'tree1', 'tree', 46.982434, 3.195675, 1, '', 'Nevers', 'Cher', 'France', 'Le Chêne <NAME>re se trouve en bordure du bocage et des jardins de la rue Pissevache sur le Val de la Baratte.', 'Association A.R.B.R.E.S.', '', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'ae08980d-20b6-4cf4-afaa-4f3746d8483e', 'Quercus', 'Chêne', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Platane de Coulanges-les-Nevers -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '74f798ff-3cfd-4482-a73f-a3c97c74b45a', 'Platane de Coulanges-les-Nevers', '', 'tree1', 'tree', 47.014401, 3.199968, 1, '<NAME>', 'Nevers', 'Cher', 'France', '', 'Association A.R.B.R.E.S.', '', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '74f798ff-3cfd-4482-a73f-a3c97c74b45a', 'Platanus', 'Platane', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Chêne de grand'maison, Sainte-Montaine -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'e59706d5-426a-4f88-b0c9-fbbd3242df43', 'Chêne de grand''maison', '', 'tree1', 'tree', 47.490521, 2.320139, 1, '', 'Sainte-Montaine', 'Cher', 'France', '', '', '', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'e59706d5-426a-4f88-b0c9-fbbd3242df43', 'Quercus', 'Chêne', NULL, 9, 400, NULL ); -------------------------------------------------------------------------------- -- Chêne Saint-Etienne -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'aa749361-dbac-4e85-8b34-c4409b3c2223', 'Chêne Saint-Etienne', '', 'tree1', 'tree', 47.314595, 2.433673, 1, 'Forêt de St Palais, ', 'Méry-ès-Bois', 'Cher', 'France', 'Le chêne Saint-Étienne figure aussi bien sur les cartes Michelin et IGN.', 'Krapo arboricole', 'https://krapooarboricole.wordpress.com/2009/08/29/chene-saint-etienne-foret-de-st-palais-mery-es-bois-cher/', NULL, false, '/trees/images/trees/FRA - 18 - Chêne Saint-Etienne/chene-saint-etienne-1.jpg', '/trees/images/trees/FRA - 18 - Chêne Saint-Etienne/chene-saint-etienne-31.jpg', NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'aa749361-dbac-4e85-8b34-c4409b3c2223', 'Quercus', 'Chêne', NULL, 4, NULL, NULL ); -------------------------------------------------------------------------------- -- Tilleul du Noyer -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'ac847657-a051-4ffb-9d60-483d70f83865', 'Tilleul du Noyer', '', 'tree1', 'tree', 47.385077, 2.683597, 0.5, '', 'Le Noyer', 'Cher', 'France', '', 'Krapo arboricole', 'https://krapooarboricole.wordpress.com/2010/03/08/un-tilleul-imposant-le-noyer-cher/', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'ac847657-a051-4ffb-9d60-483d70f83865', 'Tilia', 'Tilleul', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Saule de Beffes -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '4cda43de-15eb-497a-8ed9-d23d647139f1', 'Saule de Beffes', '', 'tree1', 'tree', 47.088339, 3.004910, 0.5, '', 'Beffes', 'Cher', 'France', '', 'Krapo arboricole', 'https://krapooarboricole.wordpress.com/2011/01/16/saule-remarquable-de-beffes-cher/', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '4cda43de-15eb-497a-8ed9-d23d647139f1', 'Salix', 'Saule', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Peuplier d’Italie de Doys -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '7f72f0d8-2bce-4e68-8e54-d639cd958364', 'Peuplier d’Italie de Doys', '', 'tree1', 'tree', 47.078884, 2.888852, 0.5, '', 'Garigny', 'Cher', 'France', 'Il pousse en face du château de Doys et de son petit bois qui renferme d’autres trésors…', 'Les tétards arboricoles', 'http://lestetardsarboricoles.fr/wordpress/2015/01/04/peuplier-doys-garigny-cher/', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '7f72f0d8-2bce-4e68-8e54-d639cd958364', 'Pop<NAME>', 'Peuplier d''Italie', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Chêne de la Crolay, Menetou-Couture -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '52b38c97-d3cd-4589-956e-7b614280884e', 'Chêne de la Crolay', '', 'tree1', 'tree', 47.046562, 2.930114, 0.5, 'La Crolay', 'Menetou-Couture', 'Cher', 'France', 'Ce chêne balise l’entrée d’une ferme qui tombe peu à peu en ruine.', 'Les tétards arboricoles', 'http://lestetardsarboricoles.fr/wordpress/2014/07/10/chene-crolay-menetou-couture-cher/', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '52b38c97-d3cd-4589-956e-7b614280884e', 'Quercus', 'Chêne', NULL, 5.80, 250, 300 ); -------------------------------------------------------------------------------- -- Saule de Bouy, Chassy -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '2d6ab96c-7481-467f-b6f1-44bd0e1a432a', 'Saule de Bouy', 'Ce saule est camouflé dans un bocage reculé derrière le village de Dejointes mais il vaut le détour.', 'tree1', 'tree', 47.026798, 2.873799, 0.5, 'Bouy', 'Chassy', 'Cher', 'France', '', 'Les tétards arboricoles', 'http://lestetardsarboricoles.fr/wordpress/2014/05/06/saule-de-bouy-chassy-cher/', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '2d6ab96c-7481-467f-b6f1-44bd0e1a432a', 'Salix', 'Saule', NULL, 5.8, NULL, NULL ); -------------------------------------------------------------------------------- -- Saule de Nérondes -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'a30813a8-cb44-490b-89be-8b05825d94eb', 'Saule de Nérondes', '', 'tree1', 'tree', 47.029672, 2.853875, 0.5, '', 'Nérondes', 'Cher', 'France', '', 'Les tétards arboricoles', 'http://lestetardsarboricoles.fr/wordpress/2012/12/28/saule-de-dejointes-nerondes-cher/', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'a30813a8-cb44-490b-89be-8b05825d94eb', 'Salix', 'Saule', NULL, 5.07, NULL, NULL ); -------------------------------------------------------------------------------- -- Cèdre du Liban de Sancerre -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '455ee9fb-8b0d-4e4e-bc93-5470a16db6d4', 'Cèdre du Liban de Sancerre', '', 'tree2', 'tree', 47.333668, 2.841928, 0.5, '', 'Sancerre', 'Cher', 'France', '', '', '', NULL, --'a177cb4a-346a-460c-bca2-69fc85832757', true, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '455ee9fb-8b0d-4e4e-bc93-5470a16db6d4', 'Cedrus libani', 'Cèdre du Liban', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- <NAME> -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'c6fd1411-99af-4430-8ba6-3f120da0e0e6', '<NAME>', '', 'tree1', 'tree', 47.219635, 2.457167, 0.5, '', 'Quantilly', 'Cher', 'France', '', 'Krapo arboricole', 'https://krapooarboricole.wordpress.com/2010/01/24/charmes-remarquables-quantilly-cher/', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'c6fd1411-99af-4430-8ba6-3f120da0e0e6', 'Carpinus', 'Charme', NULL, 3.9, NULL, NULL ); -------------------------------------------------------------------------------- -- Chêne de la Garde, Sancoins -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'ce689f4e-6de0-4583-b2d4-88abfc1cd9b5', 'Chêne de la Garde', '', 'tree1', 'tree', 46.832182, 2.949306, 0.5, '', 'Sancoins', 'Cher', 'France', '', 'Les tétards arboricoles', 'http://lestetardsarboricoles.fr/wordpress/2014/04/30/chene-de-la-garde-sancoins-cher/', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'ce689f4e-6de0-4583-b2d4-88abfc1cd9b5', 'Quercus', 'Chêne', NULL, 5.30, NULL, NULL ); -------------------------------------------------------------------------------- -- Cèdre du Liban de Saint Satur -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '39576bf4-84f2-4506-9e2e-627e0edf3b32', 'Cèdre (?) à Saint-Satur', '', 'tree2', 'tree', 47.340446, 2.855928, 0.5, '', 'Saint-Satur', 'Cher', 'France', 'Au niveau du 15, rue <NAME>', '', '', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '39576bf4-84f2-4506-9e2e-627e0edf3b32', 'Cedrus libani', 'Cèdre du Liban', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Thuya - Nogent-sur-Vernisson (45) -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '971bc352-7147-4d15-8af7-f407c4980587', 'Thuya de Nogent-sur-Vernisson', 'Thuya aux 80 troncs, collection Bizarretum, le thuya géant de l''Arboretum National des Barres à Nogent-sur-Vernisson, a reçu le label Arbre Remarquable de France en septembre 2013.', 'tree2', 'tree', 47.836502, 2.761113, 0.5, 'Arboretum National des Barres', 'Nogent-sur-Vernisson', 'Loiret', 'France', '', 'Association A.R.B.R.E.S.', '', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '971bc352-7147-4d15-8af7-f407c4980587', 'Thuja', 'Thuya', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Tilleul - Amilly (45) -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'c2211650-9374-4655-812b-51cc75760c42', '<NAME>', 'Le tilleul d''Amilly, a reçu le label Arbre Remarquable de France en novembre 2003. Le château de La Ferté datant du xviiie siècle est un ancien pavillon de chasse, sur les bords du canal de Briare, avec un parc de l’école d’<NAME>, et un tilleul de sept mètres de circonférence, classé parmi les « arbres remarquables de France »', 'tree1', 'tree', 47.958081, 2.775124, 0.5, 'Câteau de La Ferté', 'Amilly', 'Loiret', 'France', '', 'Association A.R.B.R.E.S.', '', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'c2211650-9374-4655-812b-51cc75760c42', 'Tilia', 'Tilleul', NULL, 7.00, 400, NULL ); -------------------------------------------------------------------------------- -- Tulipier - Chateauneuf-sur-Loire (45) -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'e3e84569-e23e-4a81-96d1-42394ae72540', 'Tulipier de Chateauneuf-sur-Loire', 'Le tulipier de Virginie de Chateauneuf-sur-Loire, a reçu le label Arbre Remarquable de France en juin 2009.', 'tree1', 'tree', 47.862212, 2.207148, 0.5, 'Parc départemental de Châteauneuf-sur-Loire', 'Chateauneuf-sur-Loire', 'Loiret', 'France', '', 'Association A.R.B.R.E.S.', 'http://cdt45.media.tourinsoft.eu/Upload/depliant-parc-chateauneuf.pdf', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'e3e84569-e23e-4a81-96d1-42394ae72540', 'Liriodendron tulipifera', 'Tulipier de Virginie', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Sophora - Chateauneuf-sur-Loire (45) -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '4eaab8a1-e58b-428b-a92c-636d2af90535', 'Sophora de Chateauneuf-sur-Loire', 'Le sophora du Japon de Chateauneuf-sur-Loire, a reçu le label Arbre Remarquable de France en juin 2009.', 'tree1', 'tree', 47.864159, 2.216756, 0.5, 'Parc départemental de Châteauneuf-sur-Loire', 'Chateauneuf-sur-Loire', 'Loiret', 'France', '', 'Association A.R.B.R.E.S.', 'http://cdt45.media.tourinsoft.eu/Upload/depliant-parc-chateauneuf.pdf', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '4eaab8a1-e58b-428b-a92c-636d2af90535', 'Styphnolobium japonicum', 'Sophora du Japon', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- <NAME>'Ouzouer sur Loire -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'c4cb7855-6c80-46d3-ba7c-61531df3e55c', '<NAME> d''Ouzouer sur Loire', '', 'tree1', 'tree', 47.800223, 2.456610, 0.5, '<NAME>', 'Ouzouer sur Loire', 'Loiret', 'France', 'A l’Observatoire du ravoir, au chêne Paris, au lieu dit "Le Mesnil", vers la statuette Sainte Radegonde,...', 'Krapo arboricole', 'http://www.visugpx.com/TuvusOIwbL', NULL, false, '/trees/images/trees/FRA - 51 - Chêne Paris/chene.jpg', NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'c4cb7855-6c80-46d3-ba7c-61531df3e55c', 'Quercus', 'Chêne', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Cèdre du Couasnon, Olivet -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'd5cfd4d6-9d55-471d-b91c-779b3c032b8f', 'Cèdre du Couasnon', '', 'tree2', 'tree', 47.863100, 1.899746, 0.5, 'La Chapelle de Couasnon', 'Olivet', 'Loiret', 'France', '', 'Wikipedia', 'http://chapelledecouasnon.free.fr', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'd5cfd4d6-9d55-471d-b91c-779b3c032b8f', 'Cedrus', 'Cèdre', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Chêne des Pitons -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '77d8a16c-24ae-4847-8d63-7479f21306ad', 'Chêne des Pitons', 'Certainement l''un des plus âgés, voire le plus âgé des chênes du Loiret. 400 ans d''âge ! Il serait né sous Henri IV. Le Chêne des Pitons servira d''illustration à l''un des "coupons" - ou billets - du " méreau du Gâtinais ", la monnaie locale de la partie Loiret du Gâtinais qui devrait être lancée par l''association Equilibre Monnaie - Terre au plus tard au début de l''été 2016.', 'tree1', 'tree', 48.035532, 2.855526, 0.5, 'Lieu-dit Les Pitons', 'Louzouer', 'Loiret', 'France', 'Aucun paneau ne signale sa présence. Situé au carrefour de la route qui, de la Chapelle-Saint-Sepulcre, mène au Menhir de la chaise et à la départementale 115 et de la route qui permet d''accéder au hameau des Brins à partir de Louzouer. Au pied de la ferme des Pitons', 'Wikipedia', 'http://ricjasforetmontargis.wifeo.com/louzouer-le-chene-des-pitons-le-chene-le-plus-age-du-loiret.php', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '77d8a16c-24ae-4847-8d63-7479f21306ad', 'Quercus', 'Chêne', 30, 5.40, 400, NULL ); -------------------------------------------------------------------------------- -- Le Chêne Gaulé, Forêt de Montargis -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'cab4453a-1f35-47f6-9589-6885c7d96427', '<NAME>', 'Le plus beau chêne de la Forêt de Montargis. Le symbole du village de Paucourt. Le Chêne Gaulé doit son nom au droit de panage qui remonte au Moyen Age : le porcher, durant la "glandée", a le droit de donner 3 coups d''une gaule de 13 pieds - 4 mètres - à chaque chêne, celà pour améliorer la qualité et surtout la quantité de glands récoltés et consommés sur place par les porcs', 'tree1', 'tree', 48.044068, 2.793287, 1, 'Route du chêne gaulé', 'Paucourt', 'Loiret', 'France', 'A proximité du stade', '', 'http://ricjasforetmontargis.wifeo.com/paucourt-et-la-foret-de-montargis.php', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'cab4453a-1f35-47f6-9589-6885c7d96427', 'Quercus', 'Chêne', 22, 1.3, 250, NULL ); -------------------------------------------------------------------------------- -- Le Hêtre à deux jambes -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'fdbc5ecc-b5f6-469b-b2e9-60580005197e', 'Le Hêtre à deux jambes', 'Le Hêtre à deux jambes avec le Chêne à deux jambes et le chêne siamois, une des curiosités naturelles les plus intéressantes et les plus originales de la forêt de Montargis.', 'tree1', 'tree', 48.040035, 2.814995, 0.5, 'Forêt de Montargis', 'Paucourt', 'Loiret', 'France', 'Situé à moins de 400m de la Pierre du Gros Vilain sur la commune de Paucourt, dans la parcelle 79, presque au bord du chemin forestier qui sépare cette parcelle de la parcelle 78. Ce chemin, parallèle à la Montagneuse, domine la Grande vallée Sèche. de la Pierre du Gros Vilain, il croise l''ancienne route de la Pierre, passe devant notre hêtre, rejoint la route forestière du chêne Gaulé et continue en direction de la route forestière de la Hutte.', '', 'http://ricjasforetmontargis.wifeo.com/le-hetre-a-2-jambes-arbre-remarquable-en-foret-de-montargis.php', NULL, false, NULL, NULL, NULL, NULL, NULL ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'fdbc5ecc-b5f6-469b-b2e9-60580005197e', 'Fagus sylvatica', 'Hêtre', NULL, NULL, NULL, NULL ); -------------------------------------------------------------------------------- -- Le Châtaignier de la centrale -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( 'c115c05c-76c2-41d6-9b3c-5e8813425e09', 'Le Châtaignier de la centrale', 'Uun des plus gros châtaigniers de son département', 'tree1', 'tree', 47.738682, 2.506130, 1, '', 'Dampierre-en-Burly', 'Loiret', 'France', 'Dans un champ, sous les pylônes qui soupèsent des câbles sortant directement de la centrale nucléaire de Dampierre-en-Burly.', 'Les tétards arboricoles', 'http://lestetardsarboricoles.fr/wordpress/2014/04/16/chataignier-de-la-centrale-de-dampierre-en-burly-loiret/', NULL, false, '/trees/images/trees/FRA - 51 - Châtaignier de la centrale de Dampierre en Burly/Chataignier-Dampierre-2.jpg', '/trees/images/trees/FRA - 51 - Châtaignier de la centrale de Dampierre en Burly/Chataignier-Dampierre-1.jpg', '/trees/images/trees/FRA - 51 - Châtaignier de la centrale de Dampierre en Burly/Chataignier-Dampierre-3.jpg', '/trees/images/trees/FRA - 51 - Châtaignier de la centrale de Dampierre en Burly/Chataignier-Dampierre-4.jpg', '/trees/images/trees/FRA - 51 - Châtaignier de la centrale de Dampierre en Burly/Chataignier-Dampierre-5.jpg' ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( 'c115c05c-76c2-41d6-9b3c-5e8813425e09', 'Castanea Sativa', 'Châtaignier', NULL, 7.85, NULL, NULL ); -------------------------------------------------------------------------------- -- Le châtaignier de Digons à Pébrac, Haute-Loire -------------------------------------------------------------------------------- INSERT INTO treeregister_poi ( id, name, description, icon, type, latitude, longitude, accuracy, location, city, county, country, directions, source, sourceURL, coverId, visited, picture01, picture02, picture03, picture04, picture05 ) VALUES ( '42e8b7db-7150-4888-bc97-6c4b0c8cc3fb', 'Le châtaignier de Digons', 'L’imposant châtaignier de Digons est le témoin d’un passé où la châtaigne jouait un rôle majeur dans la vie paysanne du Massif Central. Avec deux autres compagnons plus jeunes, ils sont les derniers survivants d’un ancien verger de châtaigniers. Sa position isolée et dominante à la lisière de la forêt lui confère le statut respectable de sentinelle du temps pour les habitants du hameau. Malgré sa labellisation comme Arbre remarquable de France en 2012 par l’Association ARBRES, le châtaignier de Digons reste très discret et peu connu même localement. Mais finalement, c’est peut-être aussi un bon moyen de vivre paisiblement…', 'tree1', 'tree', 45.050012, 3.532326, 0.2, '', 'Pébrac', 'Haute-Loire', 'France', '', 'Les tétards arboricoles', 'http://lestetardsarboricoles.fr/wordpress/2016/10/07/le-chataignier-de-digons-a-pebrac-haute-loire/', NULL, false, '/trees/images/trees/FRA - 43 - Le châtaignier de Digons/Chataignier-digons-pebrac2.jpg', '/trees/images/trees/FRA - 43 - Le châtaignier de Digons/Chataignier-digons-pebrac4-683x1024.jpg', '/trees/images/trees/FRA - 43 - Le châtaignier de Digons/Chataignier-digons-pebrac5-683x1024.jpg', '/trees/images/trees/FRA - 43 - Le châtaignier de Digons/Chataignier-digons-pebrac7.jpg', '/trees/images/trees/FRA - 43 - Le châtaignier de Digons/Chataignier-digons-pebrac8.jpg' ); INSERT INTO treeregister_poi_tree ( poiId, speciesLatin, speciesVernacular, height, girth, ageMin, ageMax ) VALUES ( '42e8b7db-7150-4888-bc97-6c4b0c8cc3fb', 'Castanea Sativa', 'Châtaignier', 16, 9.05, 400, NULL );
<reponame>liangzi4000/grab-share-info<filename>sql/yjbb/601878.sql EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2017-09-30',@EPS = N'0.26',@EPSDeduct = N'0',@Revenue = N'32.85亿',@RevenueYoy = N'-2.67',@RevenueQoq = N'16.57',@Profit = N'8.12亿',@ProfitYoy = N'-17.12',@ProfiltQoq = N'8.42',@NAVPerUnit = N'3.9425',@ROE = N'8.14',@CashPerUnit = N'-1.8409',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-10-25' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2017-06-30',@EPS = N'0.18',@EPSDeduct = N'0.17',@Revenue = N'20.60亿',@RevenueYoy = N'-2.54',@RevenueQoq = N'4.13',@Profit = N'5.27亿',@ProfitYoy = N'1.58',@ProfiltQoq = N'-0.40',@NAVPerUnit = N'3.8547',@ROE = N'5.36',@CashPerUnit = N'-0.3337',@GrossProfitRate = N'-',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2017-08-16' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2016-09-30',@EPS = N'0.33',@EPSDeduct = N'0',@Revenue = N'33.75亿',@RevenueYoy = N'-',@RevenueQoq = N'9.22',@Profit = N'9.80亿',@ProfitYoy = N'-',@ProfiltQoq = N'43.82',@NAVPerUnit = N'0.0000',@ROE = N'11.13',@CashPerUnit = N'0.0000',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-10-25' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2017-03-31',@EPS = N'0.09',@EPSDeduct = N'0.09',@Revenue = N'10.09亿',@RevenueYoy = N'5.28',@RevenueQoq = N'-17.24',@Profit = N'2.64亿',@ProfitYoy = N'33.20',@ProfiltQoq = N'0.97',@NAVPerUnit = N'3.2755',@ROE = N'2.72',@CashPerUnit = N'-0.4403',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-05-16' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2016-12-31',@EPS = N'0.41',@EPSDeduct = N'0.41',@Revenue = N'45.95亿',@RevenueYoy = N'-25.76',@RevenueQoq = N'-3.34',@Profit = N'12.41亿',@ProfitYoy = N'-32.36',@ProfiltQoq = N'-43.29',@NAVPerUnit = N'3.1885',@ROE = N'13.82',@CashPerUnit = N'-1.9637',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-05-22' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2015-12-31',@EPS = N'0.61',@EPSDeduct = N'0.61',@Revenue = N'61.89亿',@RevenueYoy = N'91.79',@RevenueQoq = N'-',@Profit = N'18.34亿',@ProfitYoy = N'144.52',@ProfiltQoq = N'-',@NAVPerUnit = N'2.8147',@ROE = N'24.46',@CashPerUnit = N'1.2133',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-01-18' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2015-06-30',@EPS = N'0.33',@EPSDeduct = N'0',@Revenue = N'32.74亿',@RevenueYoy = N'-',@RevenueQoq = N'-',@Profit = N'9.82亿',@ProfitYoy = N'-',@ProfiltQoq = N'-',@NAVPerUnit = N'2.5281',@ROE = N'-',@CashPerUnit = N'6.9973',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2016-07-18' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2014-12-31',@EPS = N'0.25',@EPSDeduct = N'0.25',@Revenue = N'32.27亿',@RevenueYoy = N'68.53',@RevenueQoq = N'-',@Profit = N'7.50亿',@ProfitYoy = N'86.06',@ProfiltQoq = N'-',@NAVPerUnit = N'2.1852',@ROE = N'12.19',@CashPerUnit = N'2.7453',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2016-04-29' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2013-12-31',@EPS = N'0.13',@EPSDeduct = N'0.13',@Revenue = N'19.15亿',@RevenueYoy = N'54.40',@RevenueQoq = N'-',@Profit = N'4.03亿',@ProfitYoy = N'138.13',@ProfiltQoq = N'-',@NAVPerUnit = N'1.9179',@ROE = N'7.26',@CashPerUnit = N'-0.4434',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2015-04-30' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2013-09-30',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'12.51亿',@RevenueYoy = N'-',@RevenueQoq = N'-',@Profit = N'2.77亿',@ProfitYoy = N'-',@ProfiltQoq = N'-',@NAVPerUnit = N'1.8773',@ROE = N'-',@CashPerUnit = N'0.0000',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2014-01-14' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2013-03-31',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'3.99亿',@RevenueYoy = N'-',@RevenueQoq = N'-',@Profit = N'9324.51万',@ProfitYoy = N'-',@ProfiltQoq = N'-',@NAVPerUnit = N'1.8139',@ROE = N'-',@CashPerUnit = N'0.0000',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2013-10-18' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2012-12-31',@EPS = N'0.06',@EPSDeduct = N'0.05',@Revenue = N'12.40亿',@RevenueYoy = N'-5.76',@RevenueQoq = N'-',@Profit = N'1.69亿',@ProfitYoy = N'-43.69',@ProfiltQoq = N'-',@NAVPerUnit = N'1.7825',@ROE = N'3.22',@CashPerUnit = N'-0.3944',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2014-04-30' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2011-12-31',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'13.16亿',@RevenueYoy = N'-22.53',@RevenueQoq = N'-',@Profit = N'3.01亿',@ProfitYoy = N'-51.38',@ProfiltQoq = N'-',@NAVPerUnit = N'1.7757',@ROE = N'6.05',@CashPerUnit = N'-1.4401',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2013-04-27' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2011-06-30',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'6.73亿',@RevenueYoy = N'-4.88',@RevenueQoq = N'-',@Profit = N'1.72亿',@ProfitYoy = N'-31.22',@ProfiltQoq = N'-',@NAVPerUnit = N'1.7753',@ROE = N'-',@CashPerUnit = N'0.0000',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2011-07-18' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2010-06-30',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'7.08亿',@RevenueYoy = N'-2.64',@RevenueQoq = N'-',@Profit = N'2.50亿',@ProfitYoy = N'-6.64',@ProfiltQoq = N'-',@NAVPerUnit = N'1.6195',@ROE = N'-',@CashPerUnit = N'0.0000',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2010-07-20' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2010-12-31',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'16.99亿',@RevenueYoy = N'-1.30',@RevenueQoq = N'-',@Profit = N'6.19亿',@ProfitYoy = N'0.27',@ProfiltQoq = N'-',@NAVPerUnit = N'1.7983',@ROE = N'-',@CashPerUnit = N'-0.0449',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2013-10-18' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2009-12-31',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'17.21亿',@RevenueYoy = N'104.32',@RevenueQoq = N'-',@Profit = N'6.17亿',@ProfitYoy = N'48.19',@ProfiltQoq = N'-',@NAVPerUnit = N'1.5103',@ROE = N'-',@CashPerUnit = N'2.7362',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2013-10-18' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2009-06-30',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'7.27亿',@RevenueYoy = N'50.79',@RevenueQoq = N'-',@Profit = N'2.67亿',@ProfitYoy = N'21.72',@ProfiltQoq = N'-',@NAVPerUnit = N'1.3381',@ROE = N'-',@CashPerUnit = N'0.0000',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2009-07-16' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2008-12-31',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'8.42亿',@RevenueYoy = N'-63.08',@RevenueQoq = N'-',@Profit = N'4.16亿',@ProfitYoy = N'-64.07',@ProfiltQoq = N'-',@NAVPerUnit = N'1.3511',@ROE = N'-',@CashPerUnit = N'-0.4710',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2009-04-30' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2008-06-30',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'4.82亿',@RevenueYoy = N'-56.36',@RevenueQoq = N'-',@Profit = N'2.20亿',@ProfitYoy = N'-60.48',@ProfiltQoq = N'-',@NAVPerUnit = N'1.2636',@ROE = N'-',@CashPerUnit = N'0.0000',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2008-07-18' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2007-12-31',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'22.81亿',@RevenueYoy = N'473.94',@RevenueQoq = N'-',@Profit = N'11.59亿',@ProfitYoy = N'924.23',@ProfiltQoq = N'-',@NAVPerUnit = N'1.9443',@ROE = N'-',@CashPerUnit = N'3.5876',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2008-04-30' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2016-06-30',@EPS = N'0.17',@EPSDeduct = N'0.17',@Revenue = N'21.14亿',@RevenueYoy = N'-35.43',@RevenueQoq = N'20.49',@Profit = N'5.19亿',@ProfitYoy = N'-47.19',@ProfiltQoq = N'61.73',@NAVPerUnit = N'2.9305',@ROE = N'6.00',@CashPerUnit = N'-1.3410',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-08-16' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2006-12-31',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'3.97亿',@RevenueYoy = N'162.66',@RevenueQoq = N'-',@Profit = N'1.13亿',@ProfitYoy = N'115.73',@ProfiltQoq = N'-',@NAVPerUnit = N'1.0789',@ROE = N'-',@CashPerUnit = N'2.2188',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2006-12-31' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2007-06-30',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'11.04亿',@RevenueYoy = N'474.20',@RevenueQoq = N'-',@Profit = N'5.56亿',@ProfitYoy = N'550.85',@ProfiltQoq = N'-',@NAVPerUnit = N'1.4360',@ROE = N'-',@CashPerUnit = N'0.0000',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2007-07-16' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2006-06-30',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'1.92亿',@RevenueYoy = N'-',@RevenueQoq = N'-',@Profit = N'8535.73万',@ProfitYoy = N'-',@ProfiltQoq = N'-',@NAVPerUnit = N'0.9567',@ROE = N'-',@CashPerUnit = N'0.0000',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2006-07-13' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2005-12-31',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'1.51亿',@RevenueYoy = N'-20.79',@RevenueQoq = N'-',@Profit = N'-7.19亿',@ProfitYoy = N'-1253.45',@ProfiltQoq = N'-',@NAVPerUnit = N'-0.3613',@ROE = N'-',@CashPerUnit = N'0.0000',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2006-04-30' EXEC [EST].[Proc_yjbb_Ins] @Code = N'601878',@CutoffDate = N'2016-03-31',@EPS = N'0.07',@EPSDeduct = N'0.06',@Revenue = N'9.59亿',@RevenueYoy = N'-',@RevenueQoq = N'-',@Profit = N'1.98亿',@ProfitYoy = N'-',@ProfiltQoq = N'-',@NAVPerUnit = N'0.0000',@ROE = N'2.32',@CashPerUnit = N'0.0000',@GrossProfitRate = N'-',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-05-16'
\echo # Creating messages view set search_path = api, public; create or replace view messages as select id as id, content, conversation_id, "from", "to" from data.message t; alter view messages owner to api; -- it is important to set the correct owner to the RLS policy kicks in