Advertisement
yesamarcos

To Postgre

Oct 30th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 2.67 KB | None | 0 0
  1. /*
  2. File name: C:\Users\Marcos\Desktop\biblioteca.sql
  3. Creation date: 10/30/2017
  4. Created by MySQL to PostgreSQL 3.3 [Demo]
  5. --------------------------------------------------
  6. More conversion tools at http://www.convert-in.com
  7. */
  8.  
  9. /*
  10. Table structure for table 'public.autores'
  11. */
  12.  
  13. DROP TABLE IF EXISTS "public"."autores" CASCADE;
  14. CREATE TABLE "public"."autores" (
  15.     "id" SERIAL NOT NULL,
  16.     "nome" VARCHAR(45)  NOT NULL
  17. ) WITH OIDS;
  18. DROP INDEX IF EXISTS "PRIMARY";
  19. ALTER TABLE "public"."autores" ADD CONSTRAINT "PRIMARY" PRIMARY KEY("id");
  20.  
  21. /*
  22. Dumping data for table 'public.autores'
  23. */
  24.  
  25.  
  26. /*
  27. Table structure for table 'public.editoras'
  28. */
  29.  
  30. DROP TABLE IF EXISTS "public"."editoras" CASCADE;
  31. CREATE TABLE "public"."editoras" (
  32.     "id" SERIAL NOT NULL,
  33.     "nome" VARCHAR(45)  NOT NULL
  34. ) WITH OIDS;
  35. DROP INDEX IF EXISTS "PRIMARY";
  36. ALTER TABLE "public"."editoras" ADD CONSTRAINT "PRIMARY" PRIMARY KEY("id");
  37.  
  38. /*
  39. Dumping data for table 'public.editoras'
  40. */
  41.  
  42.  
  43. /*
  44. Table structure for table 'public.livros'
  45. */
  46.  
  47. DROP TABLE IF EXISTS "public"."livros" CASCADE;
  48. CREATE TABLE "public"."livros" (
  49.     "id" SERIAL NOT NULL,
  50.     "nome" VARCHAR(45)  NOT NULL,
  51.     "id_editora" INTEGER NOT NULL,
  52.     "id_usuario" INTEGER NOT NULL
  53. ) WITH OIDS;
  54. DROP INDEX IF EXISTS "PRIMARY";
  55. ALTER TABLE "public"."livros" ADD CONSTRAINT "PRIMARY" PRIMARY KEY("id");
  56. DROP INDEX IF EXISTS "fk_livros_usuarios1_idx";
  57. CREATE INDEX "fk_livros_usuarios1_idx" ON "public"."livros"("id_usuario");
  58. DROP INDEX IF EXISTS "fk_livros_editoras1_idx";
  59. CREATE INDEX "fk_livros_editoras1_idx" ON "public"."livros"("id_editora");
  60.  
  61. /*
  62. Dumping data for table 'public.livros'
  63. */
  64.  
  65.  
  66. /*
  67. Table structure for table 'public.livros_has_autores'
  68. */
  69.  
  70. DROP TABLE IF EXISTS "public"."livros_has_autores" CASCADE;
  71. CREATE TABLE "public"."livros_has_autores" (
  72.     "livros_id" BIGINT NOT NULL,
  73.     "autores_id" BIGINT NOT NULL
  74. ) WITH OIDS;
  75. DROP INDEX IF EXISTS "fk_livros_has_autores_autores1_idx";
  76. CREATE INDEX "fk_livros_has_autores_autores1_idx" ON "public"."livros_has_autores"("autores_id");
  77. DROP INDEX IF EXISTS "fk_livros_has_autores_livros1_idx";
  78. CREATE INDEX "fk_livros_has_autores_livros1_idx" ON "public"."livros_has_autores"("livros_id");
  79.  
  80. /*
  81. Dumping data for table 'public.livros_has_autores'
  82. */
  83.  
  84.  
  85. /*
  86. Table structure for table 'public.usuarios'
  87. */
  88.  
  89. DROP TABLE IF EXISTS "public"."usuarios" CASCADE;
  90. CREATE TABLE "public"."usuarios" (
  91.     "id" SERIAL NOT NULL,
  92.     "nome" VARCHAR(45)  NOT NULL,
  93.     "email" VARCHAR(45)  NOT NULL,
  94.     "senha" VARCHAR(45)  NOT NULL
  95. ) WITH OIDS;
  96. DROP INDEX IF EXISTS "PRIMARY";
  97. ALTER TABLE "public"."usuarios" ADD CONSTRAINT "PRIMARY" PRIMARY KEY("id");
  98.  
  99. /*
  100. Dumping data for table 'public.usuarios'
  101. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement