Microsoft released a new tool a few weeks ago called mssql-scripter, which is a command-line version of the SSMS Scripting Wizard. This is a Python-based open source command line tool, and you can find the official announcement here . Essentially, the script allows you to generate a T-SQL script for your database object / database as a .sql file. You can generate the file and then execute it. This may be a good solution to create your db's schema (schema is the default option). Here's a quick use example to get you started:
$ pip install mssql-scripter
Additional usage examples are provided on our GitHub page here: https://github.com/Microsoft/sql-xplat-cli/blob/dev/doc/usage_guide.md
source share