Skip to content

Commit

Permalink
Get SQL Server tests to fun by adding Testcontainers dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sualeh committed Oct 18, 2024
1 parent 0c62b44 commit dce4e3b
Show file tree
Hide file tree
Showing 5 changed files with 2,893 additions and 0 deletions.
6 changes: 6 additions & 0 deletions schemacrawler-dbtest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
<scope>test</scope>
</dependency>
<!-- -->

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mssqlserver</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
Expand Down
266 changes: 266 additions & 0 deletions schemacrawler-dbtest/src/test/resources/testSQLServerPortable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@


Tables
========================================================================



Authors [table]
------------------------------------------------------------------------
Id int not null
FirstName varchar(20) not null
LastName varchar(20) not null
Address1 varchar(255)
Address2 varchar(255)
City varchar(50)
State char(2)
PostalCode varchar(10)
Country varchar(50)

Primary Key

[primary key]
Id

Foreign Keys

[foreign key, with no action]
Id <--(0..many) BookAuthors.AuthorId

Indexes

[unique clustered index]
Id ascending

[non-unique index]
LastName ascending
FirstName ascending

[non-unique index]
City ascending
State descending
PostalCode ascending
Country ascending



AuthorsCountries [view]
------------------------------------------------------------------------
Id int not null
FirstName varchar(20) not null
LastName varchar(20) not null
Country varchar(50)

Indexes

[unique clustered index]
FirstName ascending
LastName ascending



AuthorsList [view]
------------------------------------------------------------------------
Id int not null
FirstName varchar(20) not null
LastName varchar(20) not null



BookAuthors [table]
------------------------------------------------------------------------
BookId int not null
AuthorId int not null
SomeData varchar(30)

Foreign Keys

[foreign key, with no action]
AuthorId (0..many)--> Authors.Id

[foreign key, with no action]
BookId (0..many)--> Books.Id

Indexes

[unique index]
BookId ascending
AuthorId ascending



Books [table]
------------------------------------------------------------------------
Id int not null
Title varchar(255) not null
Description varchar(255)
PublisherId int not null
PublicationDate date
Price float(53, 0)
PreviousEditionId int

Primary Key

[primary key]
Id

Foreign Keys

[foreign key, with no action]
Id <--(0..many) BookAuthors.BookId

[foreign key, with no action]
Id <--(0..1) PreviousEditionId

Indexes

[unique clustered index]
Id ascending

[unique index]
PreviousEditionId ascending



Celebrities [table]
------------------------------------------------------------------------
Id int not null
Name varchar(20)

Primary Key

[primary key]
Id

Foreign Keys

[foreign key, with no action]
Id <--(0..1) "Celebrity Updates"."Celebrity Id"

Indexes

[unique clustered index]
Id ascending



"Celebrity Updates" [table]
------------------------------------------------------------------------
"Celebrity Id" int not null
"UPDATE" varchar(20)

Primary Key

[primary key]
"Celebrity Id"

Foreign Keys

[foreign key, with no action]
"Celebrity Id" (0..1)--> Celebrities.Id

Indexes

[unique clustered index]
"Celebrity Id" ascending



Customers [table]
------------------------------------------------------------------------
Id int not null
FirstName NAME_TYPE(100) NOT NULL
LastName NAME_TYPE(100) NOT NULL
Age AGE_TYPE

Primary Key

[primary key]
Id

Indexes

[unique clustered index]
Id ascending



Publishers [table]
------------------------------------------------------------------------
Id int identity not null
auto-incremented
Publisher varchar(255)

Primary Key

[primary key]
Id

Foreign Keys

[foreign key, with no action]
Id <--(0..many) Βιβλία.Εκδότης

Indexes

[unique clustered index]
Id ascending



X_EMPLOYEES [table]
------------------------------------------------------------------------
EMPLOYEEID int not null
EMPLOYEE_NAME varchar(30)
START_DATE date
END_DATE date
ANNUAL_SALARY int
HOURLY_RATE int
generated
ACTIVE varchar(1) not null
generated



Βιβλία [table]
------------------------------------------------------------------------
Μοναδικός smallint not null
Τίτλος varchar(255) not null
Περιγραφή varchar(255)
Εκδότης int not null

Primary Key

[primary key]
Μοναδικός

Foreign Keys

[foreign key, with no action]
Εκδότης (0..many)--> Publishers.Id

Indexes

[unique clustered index]
Μοναδικός ascending



Routines
========================================================================



"CustomAdd;0" [function, returns table]
------------------------------------------------------------------------
"@RETURN_VALUE" int, result
"@One" int, in
"@Two" int, in



"New_Publisher;1" [function, returns table]
------------------------------------------------------------------------
"@RETURN_VALUE" int, result
"@Publisher" varchar(50), in

Loading

0 comments on commit dce4e3b

Please sign in to comment.