Improved Formating for SQL Exports

Small updates to the SQL exporter:

  1. SQL Keywords are now uppercased
  2. Line breaks now occur at more sensible points so that the output is more readable

Before:

create table "participations" (
  "user_id" bigint not null,
  "project_id" bigint not null,
  "start_date" datetime not null,
  "team_id" bigint not null,
  "department" varchar(255) not null,
  "employee_id" bigint not null
);
alter table
  `participations`
add
  primary key `participations_project_id_user_id_primary`(`project_id`, `user_id`);
alter table
  `participations`
add
  unique `participations_team_id_user_id_unique`(`team_id`, `user_id`);
alter table
  `participations`
add
  index `participations_department_employee_id_index`(`department`, `employee_id`)

Now:

CREATE TABLE `participations`(
    `user_id` BIGINT NOT NULL,
    `project_id` BIGINT NOT NULL,
    `start_date` DATETIME NOT NULL,
    `team_id` BIGINT NOT NULL,
    `department` VARCHAR(255) NOT NULL,
    `employee_id` BIGINT NOT NULL
);
ALTER TABLE
    `participations` ADD PRIMARY KEY `participations_project_id_user_id_primary`(`project_id`, `user_id`);
ALTER TABLE
    `participations` ADD UNIQUE `participations_team_id_user_id_unique`(`team_id`, `user_id`);
ALTER TABLE
    `participations` ADD INDEX `participations_department_employee_id_index`(`department`, `employee_id`);

🚚 Export to Laravel Migrations

You can now export your database schema directly as Laravel migration files. Each table will be self-contained within its own migration class, and its file name automatically set to match Laravel's convention. Behind the scenes, this is powered by Jason's awesome Laravel Shift Blueprint package.

Kickstart that next app feature even quicker now. It's even easier now to transition from designing your database models in DrawSQL to your scaffolding your Laravel codebase, without having to recreate those table and columns again.

You'll find this in the revamped export modal:

We're keen to support exports to other frameworks as well, prioritized based on its popularity among DrawSQL users. Have an export format in mind? Suggest or add your vote in the roadmap here: https://drawsql.app/roadmap 


🌂Option to collapse Table Comments

You now have a new option for a more condensed view of your table comments.

Option 1: Collapsed

Some teams prefer to include extensive/longer-form notes for each of their tables. In this case, the collapsed option provides a more compact view in the diagram. The table comment will only show an icon by default which can be expanded on click.

Option 2: Always show

Always show the full table comment, useful if the included notes are usually brief and succinct. This is the default.

You can toggle this preference in file > diagram settings, as shown below:

🍯Sidebar UX improvements

Rearranged a few things in the sidebar to make it easier when creating tables & columns: 

  • Overhauled the table name edit component
  • Removed the drag handler for reordering the tables and columns. Instead, you can now just reorder by dragging anywhere within.
  • Hid secondary actions are in a Dropdown - this newfound 'space' for additional action buttons also paves way for the next upcoming features 👁️‍🗨️
  • Added a new dropdown within the top bar, especially useful for performing the common actions like adding a column or index without having to scroll to the bottom

📝Table comments, and for columns as well

One that has been a popular request since the beginning of times, today we've launched table and column notes.

This lets you leave comments for your teammates (or self) for any table and columns. 

Hopefully you'll find this one helpful and as always keen to hear any feedback.

⏫Lots of little improvements to import script for PostgreSQL

Looked through the logs top issues faced by users when importing, and made lost of improvements to the import script. 

All DBMS

  • Handle Aliases like int2, int4, int8, numeric etc.
  • Parse CREATE INDEX and CREATE UNIQUE INDEX statements
  • More instructive error logs for when the import fails

PostgreSQL

  • Added missing enum data type
  • Parse character varying data type (previously only understood varchar)
  • Differentiate timestamp and time with/without TIME ZONE

📺 Presentation mode

Sometimes it's useful to view a read-only version of your database diagram in full-screen with maximum screen real-estate. Useful for example when presenting In team discussion and tech meetings. This new presentation mode lets you do just that!

Works on your embeds too! We've used it in our recently launched template gallery, see this template of Laravel Spark for an example.


🖼️ Database schema gallery

This had been in the works for 2-months now, it's finally launched! The gallery is a collection of 200+ database schemas of open-source packages, useful as references when architecting your app's next feature. If you haven't seen it, check it out here. You can still suggest more diagrams, I plan to continuously grow the library with more schema diagrams.

Thanks to all of you that supported the launch, it went surprisingly well 🤯:

  • Featured on ProductHunt homepage for the day - Link
  • #3 on Hacker News - Link

Also gathered tons of feedback from the new users on the day, excited to work on them especially the popular ones. Presentation (full-screen) mode, and table notes would probably be next, stay tuned!

🗂️Added more data types for PostgreSQL and SQL Server

Added a few column types that were missing:

- PgSQL:

  • TIME WITH TIME ZONE
  • TIMESTAMPTZ

- SQL Server:

  • DATETIMEOFFSET

📥Clone into existing diagrams

Previously you could clone any of your diagrams to start a new diagram. With this update, you now have a new option to append the cloned diagram into any of your existing diagrams, even into a diagram of another team (as long as you have the right permissions there).

Works for any template diagrams in our template gallery (that's coming soon) as well! 

Show Previous EntriesShow Previous Entries