select name
from sys.databases;
go

create database [user] on primary
    (name=N'user_data',filename=N'/var/opt/mssql/data/user_data.mdf',size=5mb,maxsize=16mb,filegrowth=1mb)
    log on
    (name=N'user_log',filename=N'/var/opt/mssql/data/user_log.ldf',size=5mb,maxsize=16mb,filegrowth=5%)
go

use [user];

go
create table users (
                        nickname nvarchar(30),
                        id nvarchar(60) IDENTITY(1,1),
                        username nvarchar(20) not null,
                        password nvarchar(20),
                        age smallint,
                        sex nvarchar(4),
                        openid nvarchar(60),
                        city nvarchar(20),
                        province nvarchar(20),
                        country nvarchar(20),
                        wechat_id nvarchar(60),
                        weibo_id nvarchar(60),
                        qq_id nvarchar(60),
                        phone nvarchar(20),
                        email nvarchar(30),
                        tags nvarchar(200),
                        reserve nvarchar(20), --reserve inactive stand 预留字段
                        inactive nvarchar(30),
                        stand nvarchar(40),
                        primary key(id)
);
go



create table orders (
                         out_trade_no varchar(100) not null,
                         app_id varchar(100),
                         auth_app_id varchar(100),
                         body varchar(100),
                         buyer_id varchar(100),
                         buyer_logon_id varchar(100),
                         buyer_pay_amount varchar(100),
                         charset varchar(100),
                         fund_bill_list varchar(100),
                         gmt_create varchar(100),
                         gmt_payment varchar(100),
                         invoice_amount varchar(100),
                         notify_id varchar(100),
                         notify_time varchar(100),
                         notify_type varchar(100),
                         receipt_amount varchar(100),
                         seller_email varchar(100),
                         seller_id varchar(100),
                         sign text,
                         sign_type varchar(255),
                         subject varchar(255),
                         total_amount varchar(100),
                         trade_no varchar(100),
                         trade_status varchar(100),
                         version varchar(100),
                         reserve nvarchar(20), --reserve inactive stand 预留字段
                         inactive nvarchar(30),
                         stand nvarchar(40),
                         primary key (out_trade_no)
)

select name
from sys.tables;
go