mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-28 16:08:04 +00:00
#910 - SQL Server update
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<extra-ddl xmlns="http://ebean-orm.github.io/xml/ns/extraddl">
|
||||
|
||||
<ddl-script name="order views">
|
||||
<ddl-script name="order views" platforms="generic,db2,h2,hsqldb,postgres,oracle,sqlite,mysql">
|
||||
|
||||
create or replace view order_agg_vw as
|
||||
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
|
||||
@@ -11,6 +11,17 @@
|
||||
|
||||
</ddl-script>
|
||||
|
||||
<ddl-script name="order views mssql" platforms="sqlserver">
|
||||
IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME = 'order_agg_vw')
|
||||
DROP VIEW order_agg_vw;
|
||||
|
||||
create view order_agg_vw as
|
||||
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
|
||||
sum(d.ship_qty * d.unit_price) as ship_total
|
||||
from o_order_detail d
|
||||
group by d.order_id;
|
||||
</ddl-script>
|
||||
|
||||
<ddl-script name="multi comments" platforms="h2,postgres">
|
||||
-- h2 and postgres script
|
||||
</ddl-script>
|
||||
|
||||
Reference in New Issue
Block a user